Changeset 9052
- Timestamp:
- 2005-02-16T10:12:22+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r9045 r9052 203 203 File lock_file = new File(collection_directory_path + LOCK_FILE); 204 204 lock_file.delete(); 205 if (lock_file.exists()) {206 System.err.println(" Lockfile was not successfully deleted.");205 if (lock_file.exists()) { 206 System.err.println("Warning: Lockfile was not successfully deleted."); 207 207 } 208 208 … … 443 443 progress.setProgress(3); 444 444 445 // Create a lock file. 446 File lock_file = new File(collection_directory_path, LOCK_FILE); 447 FileOutputStream out = new FileOutputStream(lock_file); 448 out.write(LOCK_FILE.getBytes()); 449 out.close(); 450 out = null; 445 // Create a lock file 446 createLockFile(new File(collection_directory_path, LOCK_FILE)); 451 447 452 448 progress.setProgress(4); … … 460 456 461 457 462 public void createLockFile(File destination) { 458 private void createLockFile(File lock_file) 459 { 463 460 try { 464 461 Document default_lockfile = Utility.parse("xml/" + LOCK_FILE, true); … … 478 475 date_element = null; 479 476 date_time = null; 480 XMLTools.writeXMLFile( destination, default_lockfile);481 } 482 catch (Exception e rror) {483 DebugStream.printStackTrace(e rror);477 XMLTools.writeXMLFile(lock_file, default_lockfile); 478 } 479 catch (Exception exception) { 480 DebugStream.printStackTrace(exception); 484 481 } 485 482 } … … 488 485 public boolean deleteCollection(String collection_name) 489 486 { 490 File collection_directory = new File(getCollectionDirectoryPath(collection_name)); 491 return Utility.delete(collection_directory); 487 return Utility.delete(new File(getCollectionDirectoryPath(collection_name))); 492 488 } 493 489
Note:
See TracChangeset
for help on using the changeset viewer.