Images don't show up for demo site
Posted: Wed Jan 29, 2014 11:06 am
Class "StaticAssetStorageServiceImpl" didn't close the stream after finishing writing the temp file, resulting error message "java.io.IOException: Failed to delete original '...' after copy to '...'", possible resolution will be:
Code: Select all
File tmpFile = new File(appendTrailingSlash(workArea.getFilePathLocation()) + baseLocalFile.getName());
bos = new BufferedOutputStream(new FileOutputStream(tmpFile));
boolean eof = false;
int temp;
while (!eof) {
temp = is.read();
if (temp < 0) {
eof = true;
} else {
bos.write(temp);
}
}
bos.close() // add close stream
FileUtils.moveFile(tmpFile, baseLocalFile);