} else {
Soda2Producer producer = null;
try {
File fileToPublishFile = new File(fileToPublish);
if (publishViaDi2Http) {
try (DeltaImporter2Publisher publisher = new DeltaImporter2Publisher(userPrefs)) {
// "upsert" == "append" in di2
if ("upsert".equalsIgnoreCase(controlFile.action))
controlFile.action = "Append";
// TODO: remove the next line when di2 is updated to accept lowercase variants
controlFile.action = Utils.capitalizeFirstLetter(controlFile.action);
runStatus = publisher.publishWithDi2OverHttp(datasetID, fileToPublishFile, controlFile);
}
} else if (publishViaFTP) {
runStatus = doPublishViaFTPv2(fileToPublishFile);
} else {
// attach a requestId to all Producer API calls (for error tracking purposes)