mirror of https://github.com/apache/jclouds.git
Close OutputStream during filesystem putBlob
This commit is contained in:
parent
e9cff5e17c
commit
322d37897e
|
@ -208,8 +208,10 @@ public class FilesystemStorageStrategyImpl implements FilesystemStorageStrategy
|
||||||
Files.createParentDirs(outputFile);
|
Files.createParentDirs(outputFile);
|
||||||
if (payload.getRawContent() instanceof File)
|
if (payload.getRawContent() instanceof File)
|
||||||
Files.copy(File.class.cast(payload.getRawContent()), outputFile);
|
Files.copy(File.class.cast(payload.getRawContent()), outputFile);
|
||||||
else
|
else {
|
||||||
payload.writeTo(new FileOutputStream(outputFile));
|
output = new FileOutputStream(outputFile);
|
||||||
|
payload.writeTo(output);
|
||||||
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
if (outputFile != null) {
|
if (outputFile != null) {
|
||||||
outputFile.delete();
|
outputFile.delete();
|
||||||
|
|
Loading…
Reference in New Issue