Changeset 9045 for trunk/gli/src/org/greenstone/gatherer/gui
- Timestamp:
- 2005-02-15T15:39:48+13:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer/gui
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/DeleteCollectionPrompt.java
r9018 r9045 215 215 private void scanForCollections() { 216 216 // Start at the collect dir. 217 File collect_directory; 218 if (Gatherer.GS3) { 219 collect_directory = new File(Utility.getCollectDir(Configuration.gsdl3_path, Configuration.site_name)); 220 } else { 221 collect_directory = new File(Utility.getCollectDir(Configuration.gsdl_path)); 222 } 223 if(collect_directory.exists()) { 217 File collect_directory = new File(Gatherer.getCollectDirectoryPath()); 218 if (collect_directory.exists()) { 224 219 // Now for each child directory see if it contains a .col file and 225 220 // if so try to load it.. -
trunk/gli/src/org/greenstone/gatherer/gui/ExportCollectionPrompt.java
r9018 r9045 335 335 private void scanForCollections() { 336 336 // Start at the collect dir. 337 File collect_directory; 338 if (Gatherer.GS3) { 339 collect_directory = new File(Utility.getCollectDir(Configuration.gsdl3_path, Configuration.site_name)); 340 } else { 341 collect_directory = new File(Utility.getCollectDir(Configuration.gsdl_path)); 342 } 343 if(collect_directory.exists()) { 337 File collect_directory = new File(Gatherer.getCollectDirectoryPath()); 338 if (collect_directory.exists()) { 344 339 // Now for each child directory see if it contains a .col file and 345 340 // if so try to load it.. -
trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
r9035 r9045 621 621 } 622 622 else if(user_choice == SimpleOpenCollectionDialog.BROWSE_OPTION) { 623 File file;623 File collect_directory; 624 624 if (Gatherer.GS3) { 625 if (Configuration.gsdl3_path != null) { 626 file = new File(Utility.getSitesDir(Configuration.gsdl3_path)); 627 } else { 628 file = new File(Utility.BASE_DIR); 629 } 630 631 } else { 632 633 if(Configuration.gsdl_path != null) { 634 file = new File(Utility.getCollectDir(Configuration.gsdl_path)); 635 } 636 else { 637 file = new File(Utility.BASE_DIR); 638 } 639 } 640 OpenCollectionDialog chooser = new OpenCollectionDialog(file); 641 file = null; 625 collect_directory = new File(Utility.getSitesDir(Configuration.gsdl3_path)); 626 } 627 else { 628 collect_directory = new File(Gatherer.getCollectDirectoryPath()); 629 } 630 OpenCollectionDialog chooser = new OpenCollectionDialog(collect_directory); 642 631 filename = chooser.getFileName(); 643 632 chooser.destroy(); -
trunk/gli/src/org/greenstone/gatherer/gui/NewCollectionDetailsPrompt.java
r8803 r9045 49 49 return false; 50 50 } 51 File collection_directory; 52 if (Gatherer.GS3) { 53 collection_directory = new File(Utility.getCollectDir(Configuration.gsdl3_path, Configuration.site_name)); 54 } else { 55 collection_directory = new File(Utility.getCollectDir(Configuration.gsdl_path)); 56 } 57 File children[] = collection_directory.listFiles(); 51 File collect_directory = new File(Gatherer.getCollectDirectoryPath()); 52 File children[] = collect_directory.listFiles(); 58 53 for(int i = 0; children != null && i < children.length; i++) { 59 54 if(children[i].isDirectory()) { … … 102 97 // need to modify this to base a coll on any collection from any site 103 98 if (Gatherer.GS3) { 104 File sites_dir = new File( Utility.getSitesDir(Configuration.gsdl3_path));99 File sites_dir = new File(Gatherer.getSitesDirectoryPath()); 105 100 File [] sites = sites_dir.listFiles(); 106 101 for (int i=0; i<sites.length; i++) { 107 File collect_dir = new File(Utility.getCollectDir(Configuration.gsdl3_path, sites[i].getName()));108 if (collect_dir .exists()) {109 addCollectionsToModel(base_collection_model, collect_dir , sites[i].getName());102 File collect_directory = new File(sites_dir + sites[i].getName() + File.separator + "collect"); 103 if (collect_directory.exists()) { 104 addCollectionsToModel(base_collection_model, collect_directory, sites[i].getName()); 110 105 } 111 106 } 112 107 } else { 113 File gsdl_collection_directory = new File(Utility.getCollectDir(Configuration.gsdl_path));114 addCollectionsToModel(base_collection_model, gsdl_collection_directory, null);108 File collect_directory = new File(Gatherer.getCollectDirectoryPath()); 109 addCollectionsToModel(base_collection_model, collect_directory, null); 115 110 } 116 111 … … 266 261 } 267 262 268 private boolean filenameClashes(String filename) { 269 File collection_directory; 270 if (Gatherer.GS3) { 271 collection_directory = new File(Utility.getCollectDir(Configuration.gsdl3_path, Configuration.site_name)); 272 } else { 273 collection_directory = new File(Utility.getCollectDir(Configuration.gsdl_path)); 274 } 275 276 File children[] = collection_directory.listFiles(); 263 private boolean filenameClashes(String filename) 264 { 265 File collect_directory = new File(Gatherer.getCollectDirectoryPath()); 266 File children[] = collect_directory.listFiles(); 277 267 for(int i = 0; children != null && i < children.length; i++) { 278 268 if(children[i].getName().equals(filename)) { -
trunk/gli/src/org/greenstone/gatherer/gui/OptionsPane.java
r8313 r9045 236 236 // Build a list of the log files available, ordering by last modified. Log files are like build_log.date.txt 237 237 DefaultListModel contents = new DefaultListModel(); 238 File log_directory = new File(Gatherer.c_man.getCollectionLog ());238 File log_directory = new File(Gatherer.c_man.getCollectionLogDirectoryPath()); 239 239 File children[] = log_directory.listFiles(); 240 240 for(int i = 0; children != null && i < children.length; i++) { … … 289 289 name.append(".txt"); 290 290 // just in case there is no log directory 291 File file = new File(Gatherer.c_man.getCollectionLog () + name.toString());291 File file = new File(Gatherer.c_man.getCollectionLogDirectoryPath() + name.toString()); 292 292 File parent_file = file.getParentFile(); 293 293 parent_file.mkdirs(); -
trunk/gli/src/org/greenstone/gatherer/gui/SimpleOpenCollectionDialog.java
r8243 r9045 264 264 public CollectionListModel() { 265 265 data = new TreeSet(); 266 File collect_folder; 267 if (Gatherer.GS3) { 268 collect_folder = new File(Utility.getCollectDir(Configuration.gsdl3_path, Configuration.site_name) ); 269 } else { 270 collect_folder = new File(Utility.getCollectDir(Configuration.gsdl_path)); 271 } 272 if (!collect_folder.exists()) { 273 collect_folder = null; 266 File collect_directory = new File(Gatherer.getCollectDirectoryPath()); 267 if (!collect_directory.exists()) { 268 collect_directory = null; 274 269 return; 275 270 } 276 File[] collection_folders = collect_ folder.listFiles();271 File[] collection_folders = collect_directory.listFiles(); 277 272 for(int i = 0; i < collection_folders.length; i++) { 278 273 File collection_folder = collection_folders[i]; … … 290 285 } 291 286 collection_folders = null; 292 collect_ folder= null;287 collect_directory = null; 293 288 } 294 289
Note:
See TracChangeset
for help on using the changeset viewer.