Changeset 10363
- Timestamp:
- 2005-08-01T11:15:12+12:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r10362 r10363 149 149 Configuration.GS3_CONFIG_XML = "config3Remote.xml"; 150 150 151 File col_dir = new File(Gatherer.getCollectDirectoryPath()); 152 if (!col_dir.exists()) { 153 if (JarTools.isInJar(Utility.COLLECT_ZIP)) { 154 // Dig out collect.zip from JAR file and unzip it (thereby 155 // creating collect directory and descendants. 156 // This is done to seed gsdl home folder with config files 157 // for documented example collections so "base this on 158 // existing collection" works 159 ZipTools.unzipFromJar(Utility.COLLECT_ZIP, getGLIUserDirectoryPath()); 160 } 161 else { 162 // Prepare an empty collect dir for general use 163 if (!col_dir.mkdir()) { 164 System.err.println("Warning: Unable to make directory: " + col_dir.toString()); 165 } 166 } 167 } 168 169 File metadata_directory = new File(Gatherer.getGLIMetadataDirectoryPath()); 170 if (!metadata_directory.exists()) { 171 // dig out metadata.zip from JAR file and unzip it 172 ZipTools.unzipFromJar(Utility.METADATA_ZIP, getGLIUserDirectoryPath()); 173 } 174 175 File plug_dat = new File(getGLIUserDirectoryPath() + "plugins.dat"); 176 if (!plug_dat.exists()) { 151 File collect_directory = new File(Gatherer.getCollectDirectoryPath()); 152 if (!collect_directory.exists() && !collect_directory.mkdir()) { 153 System.err.println("Warning: Unable to make directory: " + collect_directory); 154 } 155 156 File plugins_dat_file = new File(getGLIUserDirectoryPath() + "plugins.dat"); 157 if (!plugins_dat_file.exists()) { 177 158 JarTools.extractFromJar("plugins.dat", getGLIUserDirectoryPath(), false); 178 159 } 179 160 180 File class _dat= new File(getGLIUserDirectoryPath() + "classifiers.dat");181 if (!class _dat.exists()) {161 File classifiers_dat_file = new File(getGLIUserDirectoryPath() + "classifiers.dat"); 162 if (!classifiers_dat_file.exists()) { 182 163 JarTools.extractFromJar("classifiers.dat", getGLIUserDirectoryPath(), false); 183 164 } -
trunk/gli/src/org/greenstone/gatherer/GathererApplet.java
r10362 r10363 36 36 import java.io.*; 37 37 import javax.swing.*; 38 import org.greenstone.gatherer.util.JarTools; 38 39 import org.greenstone.gatherer.util.Utility; 40 import org.greenstone.gatherer.util.ZipTools; 39 41 40 42 … … 129 131 }; 130 132 133 File collect_directory = new File(Gatherer.getCollectDirectoryPath()); 134 if (!collect_directory.exists()) { 135 if (JarTools.isInJar("collect.zip")) { 136 // Dig out collect.zip from JAR file and unzip it (thereby 137 // creating collect directory and descendants. 138 // This is done to seed gsdl home folder with config files 139 // for documented example collections so "base this on 140 // existing collection" works 141 ZipTools.unzipFromJar("collect.zip", Gatherer.getGLIUserDirectoryPath()); 142 } 143 else { 144 // Prepare an empty collect dir for use 145 if (!collect_directory.mkdir()) { 146 System.err.println("Warning: Unable to make directory: " + collect_directory); 147 } 148 } 149 } 150 151 File metadata_directory = new File(Gatherer.getGLIMetadataDirectoryPath()); 152 if (!metadata_directory.exists()) { 153 // dig out metadata.zip from JAR file and unzip it 154 ZipTools.unzipFromJar("metadata.zip", Gatherer.getGLIDirectoryPath()); 155 } 156 131 157 // Create an instance of the Gatherer class, which will parse the args and prepare the rest of the GLI 132 158 gatherer = new Gatherer(args); -
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r10345 r10363 87 87 /** Definition of an important directory name, in this case the location of the expected collection metadata sets.. */ 88 88 static final public String META_DIR = "metadata" + File.separator; // Col. Copy 89 /** Definition of an important zip file, in this case zipped up version of metadata file stored in JAR file */90 static final public String METADATA_ZIP = "metadata.zip";91 static final public String COLLECT_ZIP = "collect.zip";92 89 /** The default name of the perl executable under unix. */ 93 90 static final public String PERL_EXECUTABLE_UNIX = "perl";
Note:
See TracChangeset
for help on using the changeset viewer.