Ignore:
Timestamp:
2010-08-30T19:32:02+12:00 (14 years ago)
Author:
ak19
Message:

Fixed a bug in GLI where we weren't able to delete a collection just built (even without any docs in it) and which had just been closed. The reason was that the build_log file was never properly closed until a new collection was opened, at which point we could finally delete the previously closed collection. Now on CollectionManager.closeCollection(), GLI ensures that any currently active build_log in OptionsPane is closed (which calls the new close method in AppendLineOnlyFileDocument.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/gui/OptionsPane.java

    r21787 r22807  
    377377    return file_entry.getDocument();
    378378    }
     379   
     380    /** ensure the current build_log file has finished transferring from memory to disk, and that the random access
     381    *  file is properly closed when a collection is closed.  Else we can't delete the just-closed collection since the
     382    * build_log file resource is still kept open. */
     383    public void closeCurrentLogDocument() {
     384        if(file_entry == null) {
     385            return;
     386        }
     387        AppendLineOnlyFileDocument buildDoc = file_entry.getDocument();
     388        if(buildDoc != null) {
     389            buildDoc.close();
     390        }       
     391    }
    379392
    380393
Note: See TracChangeset for help on using the changeset viewer.