Skip to content
Snippets Groups Projects
Commit a5a2406b authored by buczekp's avatar buczekp
Browse files

[LMS-2276] close input and output streams when finished downloading file in dss-client

SVN: 21498
parent 1d06ee5c
No related branches found
No related tags found
No related merge requests found
...@@ -114,14 +114,20 @@ public final class FileInfoDssDownloader ...@@ -114,14 +114,20 @@ public final class FileInfoDssDownloader
private void downloadFile(FileInfoDssDTO fileInfo, File file) private void downloadFile(FileInfoDssDTO fileInfo, File file)
{ {
FileOutputStream fos = null;
InputStream is = null;
try try
{ {
FileOutputStream fos = new FileOutputStream(file); fos = new FileOutputStream(file);
InputStream is = dataSetDss.getFile(fileInfo.getPathInDataSet()); is = dataSetDss.getFile(fileInfo.getPathInDataSet());
IOUtils.copyLarge(is, fos); IOUtils.copyLarge(is, fos);
} catch (IOException e) } catch (IOException e)
{ {
throw new IOExceptionUnchecked(e); throw new IOExceptionUnchecked(e);
} finally
{
IOUtils.closeQuietly(fos);
IOUtils.closeQuietly(is);
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment