mirror of https://github.com/apache/archiva.git
correctly close streams
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1552191 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
14736745e4
commit
fae670bbc1
|
@ -575,17 +575,19 @@ public class DefaultFileUploadService
|
|||
private void copyFile( File sourceFile, File targetPath, String targetFilename, boolean fixChecksums )
|
||||
throws IOException
|
||||
{
|
||||
FileOutputStream out = new FileOutputStream( new File( targetPath, targetFilename ) );
|
||||
FileInputStream input = new FileInputStream( sourceFile );
|
||||
FileOutputStream out = null;
|
||||
FileInputStream input = null;
|
||||
|
||||
try
|
||||
{
|
||||
out = new FileOutputStream( new File( targetPath, targetFilename ) );
|
||||
input = new FileInputStream( sourceFile );
|
||||
IOUtils.copy( input, out );
|
||||
}
|
||||
finally
|
||||
{
|
||||
out.close();
|
||||
input.close();
|
||||
IOUtils.closeQuietly( out );
|
||||
IOUtils.closeQuietly( input );
|
||||
}
|
||||
|
||||
if ( fixChecksums )
|
||||
|
|
Loading…
Reference in New Issue