Changeset 9883
- Timestamp:
- 2005-05-16T15:17:54+12:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/GathererApplet.java
r9876 r9883 152 152 File col_dir = new File(Gatherer.getCollectDirectoryPath()); 153 153 if (!col_dir.exists()) { 154 col_dir.mkdir(); 155 } 154 155 if (Utility.isInJar(Utility.COLLECT_ZIP)) { 156 // Dig out collect.zip from JAR file and unzip it (thereby 157 // creating collect directory and descendants. 158 // This is done to seed gsdl home folder with config files 159 // for documented example collections so "base this on 160 // existing collection" works 161 Utility.unzipFromJar(Utility.COLLECT_ZIP,gli_user_directory.toString()); 162 } 163 else { 164 // Prepare an empty collect dir for general use 165 col_dir.mkdir(); 166 } 167 } 168 169 /* 170 File tmp_dir = new File(Utility.TMP_DIR); 171 if (!tmp_dir.exists()) { 172 tmp_dir.mkdir(); 173 } 174 */ 156 175 157 176 File metadata_directory = new File(Utility.METADATA_DIR); 158 177 if (!metadata_directory.exists()) { 159 // dig out metadata.zip from JAR file and unzip it178 // dig out metadata.zip from JAR file and unzip it 160 179 Utility.unzipFromJar(Utility.METADATA_ZIP, gli_user_directory.toString()); 161 180 } -
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r9876 r9883 111 111 /** Definition of an important zip file, in this case zipped up version of metadata file stored in JAR file */ 112 112 static final public String METADATA_ZIP = "metadata.zip"; 113 static final public String COLLECT_ZIP = "collect.zip"; 113 114 /** The default name of the perl executable under unix. */ 114 115 static final public String PERL_EXECUTABLE_UNIX = "perl"; … … 518 519 519 520 521 static public boolean isInJar(String filename) 522 { 523 try { 524 InputStream fis = base.getResourceAsStream("/"+filename); 525 526 fis.close(); 527 528 } 529 catch (Exception error) { 530 System.err.println("**** collect.zip not there!"); 531 error.printStackTrace(); 532 533 534 return false; 535 } 536 return true; 537 } 538 539 540 520 541 static public void extractFromJar(String filename, String dst_dir, boolean must_be_present) 521 542 {
Note:
See TracChangeset
for help on using the changeset viewer.