Merge pull request #128 from andrewgaul/filesystem-putblob-closeoutputstream

Close OutputStream during filesystem putBlob
This commit is contained in:
Adrian Cole 2011-11-10 00:43:33 -08:00
commit e157a54421
1 changed files with 4 additions and 2 deletions

View File

@ -208,8 +208,10 @@ public class FilesystemStorageStrategyImpl implements FilesystemStorageStrategy
Files.createParentDirs(outputFile);
if (payload.getRawContent() instanceof File)
Files.copy(File.class.cast(payload.getRawContent()), outputFile);
else
payload.writeTo(new FileOutputStream(outputFile));
else {
output = new FileOutputStream(outputFile);
payload.writeTo(output);
}
} catch (IOException ex) {
if (outputFile != null) {
outputFile.delete();