Skip to content

Commit 657f761

Browse files
committed
Merge pull request #95 from TLuthra/download-disconnect
Long download requests
2 parents a5d4b3e + 3ecffda commit 657f761

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/main/java/com/box/sdk/BoxFile.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ public void download(OutputStream output, ProgressListener listener) {
121121
}
122122
} catch (IOException e) {
123123
throw new BoxAPIException("Couldn't connect to the Box API due to a network error.", e);
124+
} finally {
125+
response.disconnect();
124126
}
125-
126-
response.disconnect();
127127
}
128128

129129
/**
@@ -175,9 +175,9 @@ public void downloadRange(OutputStream output, long rangeStart, long rangeEnd, P
175175
}
176176
} catch (IOException e) {
177177
throw new BoxAPIException("Couldn't connect to the Box API due to a network error.", e);
178+
} finally {
179+
response.disconnect();
178180
}
179-
180-
response.disconnect();
181181
}
182182

183183
@Override

0 commit comments

Comments
 (0)