Changeset 31293

Show
Ignore:
Timestamp:
16.01.2017 11:43:42 (2 years ago)
Author:
davidb
Message:

Close input and output streams before exiting via exception

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/file/FileQueue.java

    r24636 r31293  
    800800    catch (FileNotFoundException exception) { 
    801801        // A FileNotFoundException translates into a WriteNotPermittedException in this case 
     802        f_in.close(); 
    802803        throw new WriteNotPermittedException(exception.toString()); 
    803804    } 
     
    813814        // If an IO exception occurs, we can do some maths to determine if the number of bytes written to the file was less than expected. If so we assume a InsufficientSpace exception. If not we just throw the exception again. 
    814815        catch (IOException io_exception) { 
     816        f_in.close(); 
     817        f_out.close(); 
     818 
    815819        if (destination_size + (long) data_size > destination.length()) { 
    816820            // Determine the difference (which I guess is in bytes).