Changeset 22807
- Timestamp:
- 2010-08-30T19:32:02+12:00 (14 years ago)
- Location:
- main/trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r22780 r22807 418 418 Gatherer.remoteGreenstoneServer.deleteCollectionFile(collection.getGroupQualifiedName(false), lock_file); 419 419 } 420 421 // release the current build_log file - else we're unable to delete the last closed collection 422 // until another collection is opened and its opening a new build_log closes this old one 423 Gatherer.g_man.create_pane.options_pane.closeCurrentLogDocument(); 420 424 421 425 MetadataSetManager.clearMetadataSets(); -
main/trunk/gli/src/org/greenstone/gatherer/gui/OptionsPane.java
r21787 r22807 377 377 return file_entry.getDocument(); 378 378 } 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 } 379 392 380 393 -
main/trunk/gli/src/org/greenstone/gatherer/util/AppendLineOnlyFileDocument.java
r15862 r22807 172 172 } 173 173 174 /** ensure the current build_log file has finished transferring from memory to disk, and that the random access 175 * file is properly closed when a collection is closed. Else we can't delete the just-closed collection since the 176 * build_log file resource is still kept open. */ 177 public void close() { 178 if(writer == null) { // closed already 179 return; 180 } 181 // get rid of the writer and then close the file 182 setExit(); 183 writer = null; 184 try { 185 file.close(); 186 } catch(Exception exception) { 187 DebugStream.println("Exception in AppendLineOnlyFileDocument.close() - Unable to close internal file"); 188 DebugStream.printStackTrace(exception); 189 } 190 } 191 174 192 /** The destructor is implemented to ensure the current log file has finished transferring from memory to disk, and that the random access file is properly closed, before GLI exits. 175 193 * @see org.greenstone.gatherer.util.AppendLineOnlyFileDocument.WriterThread#finish … … 177 195 public void destroy() { 178 196 try { 179 writer.finish(); 180 file.close(); 197 if(writer != null) { 198 writer.finish(); 199 writer = null; 200 file.close(); 201 } 181 202 } 182 203 catch(Exception exception) {
Note:
See TracChangeset
for help on using the changeset viewer.