public Path runTilesInParallel(int threadCount, Executor threadPool) throws Exception {
long startTime = System.currentTimeMillis();
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, "");
logger.log(Level.FINE, "Start writing the product bands into local disk files: source product: '"+this.sourceProduct.getName()+"', image width: "+getImageWidth()+", image height: "+getImageHeight() + ", start time: " + new Date(startTime));
logger.log(Level.FINE, "Temporary folder path to store the binary files: '" + this.temporaryFolder.toFile().getAbsolutePath()+"'");
}
boolean success = false;
try {
super.executeInParallel(threadCount, threadPool);
success = true;
} finally {
if (!success) {
FileUtils.deleteTree(this.temporaryFolder.toFile());
}
}
if (logger.isLoggable(Level.FINE)) {
long finishTime = System.currentTimeMillis();
long totalSeconds = (finishTime - startTime) / 1000;
logger.log(Level.FINE, "");
logger.log(Level.FINE, "Finish writing product bands into local disk files: source product: '"+this.sourceProduct.getName()+"', image width: "+getImageWidth()+", image height: "+getImageHeight()+", total seconds: "+totalSeconds+", finish time: "+new Date(finishTime));
}
return this.temporaryFolder;
}
}