Skip to content

Commit 735be49

Browse files
natario1rogerhu
authored andcommitted
Closing streams in ParseAWSRequest (#590)
* Update ParseAWSRequest.java
1 parent 3fced98 commit 735be49

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Parse/src/main/java/com/parse/ParseAWSRequest.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ public Void call() throws Exception {
5454
long totalSize = response.getTotalSize();
5555
long downloadedSize = 0;
5656
InputStream responseStream = null;
57+
FileOutputStream tempFileStream = null;
5758
try {
5859
responseStream = response.getContent();
59-
FileOutputStream tempFileStream = ParseFileUtils.openOutputStream(tempFile);
60+
tempFileStream = ParseFileUtils.openOutputStream(tempFile);
6061

6162
int nRead;
6263
byte[] data = new byte[32 << 10]; // 32KB
@@ -73,6 +74,7 @@ public Void call() throws Exception {
7374
return null;
7475
} finally {
7576
ParseIOUtils.closeQuietly(responseStream);
77+
ParseIOUtils.closeQuietly(tempFileStream);
7678
}
7779
}
7880
}, ParseExecutors.io());

0 commit comments

Comments
 (0)