Changeset 7468
- Timestamp:
- 2004-05-27T14:12:54+12:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/CollectionManager.java
r7311 r7468 41 41 import org.greenstone.gsdl3.util.GSXML; 42 42 import org.greenstone.gsdl3.util.XMLConverter; 43 43 import org.greenstone.gsdl3.util.URLTools; 44 44 45 45 /** … … 60 60 GS3SQLConnection database; // the database to store everything in 61 61 String collectionHome; 62 StringsiteHome;62 String siteHome; 63 63 String collectionName; 64 StringqualifiedCollectionName; // used as the database name65 66 BuildManagerbuildManager;64 String qualifiedCollectionName; // used as the database name 65 66 BuildManager buildManager; 67 67 68 68 class CollectionClassifier … … 113 113 114 114 public ClassifierInterface getClassifier() 115 { 116 ClassifierInterface classifier = null; 115 { ClassifierInterface classifier = null; 117 116 118 117 if (this.type == null) { … … 120 119 } 121 120 System.out.println(this.type.toLowerCase()); 121 122 122 if (this.type.toLowerCase().equals("hierarchy")) { 123 123 classifier = new HierarchyClassifier(this.className, this.file, this.fields, this.sort); 124 124 } 125 125 else if (this.type.toLowerCase().equals("azlist")) { 126 126 classifier = new AZListClassifier(this.className, this.fields); 127 127 } 128 128 … … 137 137 * @param collection <code>String</code> the name of the collection 138 138 */ 139 140 141 142 143 144 145 146 147 139 public CollectionManager(String site, String collection) { 140 141 String gsdl3Root = System.getProperty("GSDL3HOME"); 142 if (gsdl3Root == null) { 143 System.out.println("Error: Unable to locate GSDL3HOME"); 144 System.exit(1); 145 //return; 146 } 147 148 148 this.siteHome = GSFile.siteHome(gsdl3Root, site); 149 149 File site_dir = new File(this.siteHome); 150 150 if (!site_dir.exists()) { 151 152 151 System.out.println("Error: Non-existant site ("+site+") specified"); 152 System.exit(1); 153 153 } 154 154 site_dir = null; … … 157 157 File collect_dir = new File(this.collectionHome); 158 158 if (!collect_dir.exists()) { 159 160 159 System.out.println("Error: Non-existant collection ("+collection+") specified in site "+site); 160 System.exit(1); 161 161 } 162 162 collect_dir = null; … … 165 165 this.qualifiedCollectionName = site+"_"+collection; 166 166 167 167 this.database = GS3SQLConnectionFactory.createConnection(this.qualifiedCollectionName); 168 168 /* if (this.database != null) { 169 169 this.database.clearCollection(collection); … … 178 178 this.metadata = new CollectionMetadata(); 179 179 180 181 180 File buildDirectory = new File(GSFile.collectionBuildDir(this.collectionHome)); 182 181 if (!buildDirectory.exists()) { … … 201 200 202 201 try { 203 etcURL = new URL("file://"+etcFile.toString());202 etcURL = URLTools.getFileURL(etcFile); 204 203 } 205 204 catch (java.net.MalformedURLException malEx) {
Note:
See TracChangeset
for help on using the changeset viewer.