Changeset 7224 for trunk/gli/src
- Timestamp:
- 2004-04-23T14:56:30+12:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/SuperCollectionManager.java
r6144 r7224 191 191 // We start by building a model of the installed collections. 192 192 collection_checklist_model = new ArrayList(); 193 File gsdl_collection_directory = new File(Utility.getCollect ionDir(Gatherer.config.gsdl_path));193 File gsdl_collection_directory = new File(Utility.getCollectDir(Gatherer.config.gsdl_path)); 194 194 current_coll_name = Gatherer.c_man.getCollection().getName(); 195 195 File[] possible_collections = gsdl_collection_directory.listFiles(); -
trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r7207 r7224 215 215 closing_thread = Thread.currentThread(); 216 216 // Remove the lock on this file, then remove the collection. 217 File lock_file = new File(Utility.getCollectionDir(Gatherer.config.gsdl_path ) + collection.getName() + File.separator+ LOCK_FILE);217 File lock_file = new File(Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getName()) + LOCK_FILE); 218 218 lock_file.delete(); 219 219 if(lock_file.exists()) { … … 257 257 makeCollection(description, email, name, title); 258 258 progress.setProgress(1); 259 String a_dir = Utility.getCollectionDir(Gatherer.config.gsdl_path ) + name + File.separator;259 String a_dir = Utility.getCollectionDir(Gatherer.config.gsdl_path, name); 260 260 261 261 // ACTIVE_DIR/log/ … … 491 491 */ 492 492 public String getCollectionArchive() { 493 return Utility.getArchiveDir( Gatherer.config.gsdl_path, collection.getName());493 return Utility.getArchiveDir(Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getName())); 494 494 } 495 495 /** Constructs the absolute filename of the collection building directory, which should resemble "$GSDLHOME/collect/<col_name>/building/" … … 501 501 */ 502 502 public String getCollectionBuild() { 503 return Utility.getBuildDir(Utility.getCollectionDir(Gatherer.config.gsdl_path ) + collection.getName() + File.separator);503 return Utility.getBuildDir(Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getName())); 504 504 } 505 505 … … 512 512 */ 513 513 public String getCollectionConfig() { 514 return Utility.getConfigDir(Utility.getCollectionDir(Gatherer.config.gsdl_path ) + collection.getName() + File.separator);514 return Utility.getConfigDir(Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getName())); 515 515 } 516 516 … … 523 523 */ 524 524 public String getCollectionDirectory() { 525 return Utility.getCollectionDir(Gatherer.config.gsdl_path ) + collection.getName() + File.separator;525 return Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getName()); 526 526 } 527 527 … … 534 534 */ 535 535 public String getCollectionEtc() { 536 return Utility.getEtcDir(Utility.getCollectionDir(Gatherer.config.gsdl_path ) + collection.getName() + File.separator);536 return Utility.getEtcDir(Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getName())); 537 537 } 538 538 /** Constructs the absolute filename of the collection file, which should resemble "$GSDLHOME/collect/<col_name>/<col_name>.col" … … 544 544 */ 545 545 public String getCollectionFilename() { 546 return Utility.getCollectionDir(Gatherer.config.gsdl_path ) + collection.getName() + File.separator+ collection.getName() + ".col";546 return Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getName()) + collection.getName() + ".col"; 547 547 } 548 548 /** Constructs the absolute filename of the collection images directory, which should resemble "$GSDLHOME/collect/<col_name>/images/" … … 554 554 */ 555 555 public String getCollectionImages() { 556 return Utility.get CollectionDir(Gatherer.config.gsdl_path) + collection.getName() + File.separator + StaticStrings.IMAGES_FOLDER;556 return Utility.getImagesDir(Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getName())); 557 557 } 558 558 /** Constructs the absolute filename of the collection import directory, which should resemble "$GSDLHOME/collect/<col_name>/import/" … … 564 564 */ 565 565 public String getCollectionImport() { 566 return Utility.getImportDir(Utility.getCollectionDir(Gatherer.config.gsdl_path ) + collection.getName() + File.separator);566 return Utility.getImportDir(Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getName())); 567 567 } 568 568 /** Constructs the absolute filename of the collection index directory, which should resemble "$GSDLHOME/collect/<col_name>/index/" … … 574 574 */ 575 575 public String getCollectionIndex() { 576 return Utility.getIndexDir(Utility.getCollectionDir(Gatherer.config.gsdl_path ) + collection.getName() + File.separator);576 return Utility.getIndexDir(Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getName())); 577 577 } 578 578 /** Constructs the absolute filename of the collection log directory, which should resemble "$GSDLHOME/collect/<col_name>/log/" … … 584 584 */ 585 585 public String getCollectionLog() { 586 return Utility.getLogDir(Utility.getCollectionDir(Gatherer.config.gsdl_path ) + collection.getName() + File.separator);586 return Utility.getLogDir(Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getName())); 587 587 } 588 588 /** Constructs the absolute filename of the collection metadata directory, which should resemble "$GSDLHOME/collect/<col_name>/metadata/" … … 594 594 */ 595 595 public String getCollectionMetadata() { 596 return Utility.getMetadataDir(Utility.getCollectionDir(Gatherer.config.gsdl_path ) + collection.getName() + File.separator);596 return Utility.getMetadataDir(Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getName())); 597 597 } 598 598 -
trunk/gli/src/org/greenstone/gatherer/collection/DeleteCollectionPrompt.java
r6842 r7224 217 217 private void scanForCollections() { 218 218 // Start at the collect dir. 219 String collect_directory_name = Utility.getCollect ionDir(Gatherer.config.gsdl_path);219 String collect_directory_name = Utility.getCollectDir(Gatherer.config.gsdl_path); 220 220 File collect_directory = new File(collect_directory_name); 221 221 if(collect_directory.exists()) { … … 311 311 } 312 312 313 File delete_me = new File(Utility.getCollectionDir(Gatherer.config.gsdl_path ) + collection.getShortName() + File.separator);313 File delete_me = new File(Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getShortName())); 314 314 if(Utility.delete(delete_me)) { 315 315 if (Gatherer.c_man.getCollection() != null && collection.getShortName().equals(Gatherer.c_man.getCollection().getName())) { -
trunk/gli/src/org/greenstone/gatherer/collection/ExportCollectionPrompt.java
r7160 r7224 345 345 private void scanForCollections() { 346 346 // Start at the collect dir. 347 String collect_directory_name = Utility.getCollect ionDir(Gatherer.config.gsdl_path);347 String collect_directory_name = Utility.getCollectDir(Gatherer.config.gsdl_path); 348 348 File collect_directory = new File(collect_directory_name); 349 349 if(collect_directory.exists()) { -
trunk/gli/src/org/greenstone/gatherer/collection/SaveCollectionTask.java
r6842 r7224 163 163 ArrayList files = new ArrayList(); 164 164 File collection_file = new File(Gatherer.c_man.getCollectionFilename()); 165 File copied_dir = new File(Utility.getCollect ionDir(Gatherer.config.gsdl_path) + name);165 File copied_dir = new File(Utility.getCollectDir(Gatherer.config.gsdl_path) + name); 166 166 files.add(collection_file.getParentFile()); 167 167 while(files.size() > 0) { -
trunk/gli/src/org/greenstone/gatherer/file/FileNode.java
r7122 r7224 273 273 ///atherer.println("Map the 'Greenstone Collections' node."); 274 274 // For each of the children directories, which are collections... 275 File start = new File(Utility.getCollect ionDir(Gatherer.config.gsdl_path));275 File start = new File(Utility.getCollectDir(Gatherer.config.gsdl_path)); 276 276 File cols[] = start.listFiles(); 277 277 ArrayTools.sort(cols); -
trunk/gli/src/org/greenstone/gatherer/gui/BuildOptions.java
r5589 r7224 156 156 */ 157 157 public BuildOptions() { 158 collectdir_value = Utility.getCollect ionDir(Gatherer.config.gsdl_path);158 collectdir_value = Utility.getCollectDir(Gatherer.config.gsdl_path); 159 159 // If we have a collection open gets its details. 160 160 if(Gatherer.c_man.ready()) { -
trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
r6879 r7224 719 719 File file; 720 720 if(Gatherer.config.gsdl_path != null) { 721 file = new File(Utility.getCollect ionDir(Gatherer.config.gsdl_path));721 file = new File(Utility.getCollectDir(Gatherer.config.gsdl_path)); 722 722 } 723 723 else { -
trunk/gli/src/org/greenstone/gatherer/gui/NewCollectionDetailsPrompt.java
r7158 r7224 51 51 return false; 52 52 } 53 File collection_directory = new File(Utility.getCollect ionDir(Gatherer.config.gsdl_path));53 File collection_directory = new File(Utility.getCollectDir(Gatherer.config.gsdl_path)); 54 54 File children[] = collection_directory.listFiles(); 55 55 for(int i = 0; children != null && i < children.length; i++) { … … 104 104 // Model building. Build a model of all of the collections in the gsdl collect directory with the appropriate directories. 105 105 Vector base_collection_model = new Vector(); 106 File gsdl_collection_directory = new File(Utility.getCollect ionDir(Gatherer.config.gsdl_path));106 File gsdl_collection_directory = new File(Utility.getCollectDir(Gatherer.config.gsdl_path)); 107 107 File[] possible_collections = gsdl_collection_directory.listFiles(); 108 108 for (int i = 0; possible_collections != null && i < possible_collections.length; i++) { … … 322 322 323 323 private boolean filenameClashes(String filename) { 324 File collection_directory = new File(Utility.getCollect ionDir(Gatherer.config.gsdl_path));324 File collection_directory = new File(Utility.getCollectDir(Gatherer.config.gsdl_path)); 325 325 File children[] = collection_directory.listFiles(); 326 326 for(int i = 0; children != null && i < children.length; i++) { … … 342 342 File file; 343 343 if(Gatherer.config.gsdl_path != null) { 344 file = new File(Utility.getCollect ionDir(Gatherer.config.gsdl_path));344 file = new File(Utility.getCollectDir(Gatherer.config.gsdl_path)); 345 345 } 346 346 else { … … 417 417 if(name_final.length() > 0) { 418 418 // Determine if this filename is already in use. 419 File collection_directory = new File(Utility.getCollect ionDir(Gatherer.config.gsdl_path));419 File collection_directory = new File(Utility.getCollectDir(Gatherer.config.gsdl_path)); 420 420 File children[] = collection_directory.listFiles(); 421 421 for(int i = 0; children != null && i < children.length; i++) { -
trunk/gli/src/org/greenstone/gatherer/mem/MEMNode.java
r6203 r7224 149 149 boolean is_descendant = false; 150 150 File source_path = new File((String)userObject); 151 File collect_path = new File(Utility.getCollect ionDir(Gatherer.config.gsdl_path));151 File collect_path = new File(Utility.getCollectDir(Gatherer.config.gsdl_path)); 152 152 File current_path = source_path; 153 153 while(!is_descendant && current_path != null) { -
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r7014 r7224 110 110 /** Definition of an important directory name, in this case the location of help documentation. */ 111 111 static final public String HELP_DIR = BASE_DIR + "help" + File.separator; 112 /** Definition of an important directory name, in this case the images directory for the collection. */ 113 static final public String IMAGES_DIR = "images" + File.separator; 112 114 /** Definition of an important directory name, in this case the import directory for the collection. */ 113 115 static final public String IMPORT_DIR = "import" + File.separator; … … 460 462 461 463 /** Method which constructs the archive directory given a certain collection. 462 * @param gsdl_path The location of the greenstone installation as a <strong>String</strong>. 463 * @param col_name The collection name 464 * @param gsdl_path The location of the collection directory as a <strong>String</strong>. 464 465 * @return The location of the given collections archive directory, also as a <strong>String</strong>. 465 466 */ 466 static public String getArchiveDir(String gsdl_path, String col_name) {467 return gsdl_path + File.separator + COL_DIR + col_name + File.separator + ARCHIVE_DIR;467 static public String getArchiveDir(String col_dir) { 468 return col_dir + ARCHIVE_DIR; 468 469 } 469 470 /** Method which constructs the build directory given a certain collection. … … 483 484 return new File(getGLIUserFolder(), StaticStrings.CACHE_FOLDER); 484 485 } 485 /** Method which constructs the collect iondirectory for Greenstone.486 /** Method which constructs the collect directory for Greenstone. 486 487 * @param gsdl_path The location of the gsdl installation directory as a <strong>String</strong>. 487 488 * @return The location of the collection directory, also as a <strong>String</strong>. 488 489 */ 489 public static String getCollect ionDir(String gsdl_path) {490 public static String getCollectDir(String gsdl_path) { 490 491 return gsdl_path + COL_DIR; 491 492 } 493 494 /** Method which constructs a collection's top level directory 495 * @@param gsdl_path The location of the gsdl installation directory as a <strong>String</strong>. 496 * @param The name of the collection as a <strong>String</strong>. 497 * @return The location of the collection's base directory 498 */ 499 public static String getCollectionDir(String gsdl_path, String coll_name) { 500 return getCollectDir(gsdl_path) + coll_name + File.separator; 501 } 502 492 503 /** Method which constructs the configuration file given a certain collection. 493 504 * @param col_dir The location of the collection directory as a <strong>String</strong>. … … 610 621 } 611 622 623 /** Method which constructs the images directory given a certain collection. 624 * @param col_dir The location of the collection directory as a <strong>String</strong>. 625 * @return The location of the given collections images directory, also as a <strong>String</strong>. 626 */ 627 public static String getImagesDir(String col_dir) { 628 return col_dir + IMAGES_DIR; 629 } 612 630 /** Method which constructs the import directory given a certain collection. 613 631 * @param col_dir The location of the collection directory as a <strong>String</strong>.
Note:
See TracChangeset
for help on using the changeset viewer.