Changeset 4584
- Timestamp:
- 2003-06-11T16:40:23+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r4557 r4584 178 178 */ 179 179 public void closeCollection() { 180 // System.err.println("Closing collection..."); 180 181 // Remove the lock on this file, then remove the collection. 181 182 File lock_file = new File(Utility.getCollectionDir(Gatherer.config.gsdl_path) + collection.getName() + File.separator + LOCK_FILE); … … 188 189 Gatherer.config.setCollectionConfiguration(null); 189 190 Gatherer.g_man.collectionChanged(false); 191 // System.err.println("Closed collection."); 190 192 } 191 193 … … 612 614 current_collection_directory = Utility.getCollectionDir(Gatherer.config.gsdl_path) + collection.getName(); 613 615 } 616 614 617 // Create the workspace tree. 615 618 FileNode workspace_root = new FileNode("ABS_ROOT"); … … 625 628 // We add their import and gimport directories, but only if its not our current collection. 626 629 for(int i = 0; cols != null && i < cols.length; i++) { 627 ///ystem.err.println(current_collection_directory); 628 ///ystem.err.println(cols[i].getName() + " = modelcol"); 630 ///ystem.err.print("Collection: " + collection); 631 ///ystem.err.print(" Current collection dir: " + current_collection_directory); 632 ///ystem.err.print(" Col " + i + " : " + cols[i] + "\n"); 629 633 if(collection == null || (!current_collection_directory.equals(cols[i].getAbsolutePath()) && !cols[i].getName().equals("modelcol"))) { 630 634 File dirs[] = cols[i].listFiles(); … … 779 783 // Open the collection file 780 784 collection = new Collection(collection_file); 785 // System.err.println("In CollectionManager::loadCollection(), collection: " + collection); 781 786 collection.msm = new MetadataSetManager(); 782 787 msm = collection.msm; // Legacy … … 794 799 } 795 800 result = true; 801 // System.err.println("Done loadCollection()."); 796 802 } catch (Exception error) { 797 803 // There is obviously no existing collection present. … … 997 1003 try { 998 1004 SaveCollectionTask save_task = new SaveCollectionTask(collection, close_after, exit_after); 999 save_task.start(); 1005 // Run this in the same thread 1006 save_task.run(); 1000 1007 } 1001 1008 catch(Exception error) { … … 1078 1085 private void installCollection() { 1079 1086 Gatherer.println("Build complete. Moving files."); 1080 1087 1088 // System.err.println("Build mode: " + collection.build_options.getBuildValue("mode")); 1089 1081 1090 try { 1082 1091 // We have to ensure that the local library … … 1085 1094 Gatherer.g_man.preview_pane.configServer(GSDLSiteConfig.RELEASE_COMMAND + collection.getName()); 1086 1095 } 1087 1096 1088 1097 File index_dir = new File(getCollectionIndex(), "temp.txt"); 1089 1098 index_dir = index_dir.getParentFile(); 1090 1099 Gatherer.println("Index = " + index_dir.getAbsolutePath()); 1091 1092 if(index_dir.exists()) { 1093 Utility.delete(index_dir); 1094 } 1095 1096 if(index_dir.exists()) { 1097 throw(new Exception("Index directory cannot be removed.")); 1098 } 1099 1100 1100 1101 File build_dir = new File(getCollectionBuild(), "temp.txt"); 1101 1102 build_dir = build_dir.getParentFile(); 1102 1103 Gatherer.println("Build = " + build_dir.getAbsolutePath()); 1104 1105 // Remove the old index directory 1106 if (index_dir.exists()) { 1107 Utility.delete(index_dir); 1108 if (index_dir.exists()) { 1109 throw new Exception("Index directory cannot be removed."); 1110 } 1111 } 1112 1113 // Move the building directory to become the new index directory 1103 1114 build_dir.renameTo(index_dir); 1104 1115 1116 // Create a new building directory 1105 1117 File new_build = new File(getCollectionBuild(), "temp.txt"); 1106 1118 new_build = new_build.getParentFile();
Note:
See TracChangeset
for help on using the changeset viewer.