Ignore:
Timestamp:
2017-01-16T11:43:42+13:00 (7 years ago)
Author:
davidb
Message:

Close input and output streams before exiting via exception

File:
1 edited

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).
Note: See TracChangeset for help on using the changeset viewer.