Changeset 22358
- Timestamp:
- 2010-07-06T15:36:14+12:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r21880 r22358 581 581 582 582 // Now create the collection object around the directory. 583 collection = new Collection(new File(collection_directory_path, name + ".col"));583 collection = new Collection(new File(collection_directory_path, "gli.col")); 584 584 585 585 // for remote case, scheduling causes an Exception on creating a new collection that … … 884 884 static public String getLoadedCollectionColFilePath() 885 885 { 886 return getLoadedCollectionDirectoryPath() + collection.getName() + ".col";886 return getLoadedCollectionDirectoryPath() + "gli.col"; 887 887 } 888 888 … … 1184 1184 DebugStream.println("Loading collection " + location + "..."); 1185 1185 1186 if (Gatherer.isGsdlRemote) {1187 String collection_name = location.substring(location.lastIndexOf(File.separator) + 1, location.length() - ".col".length());1188 if (Gatherer.remoteGreenstoneServer.downloadCollection(collection_name).equals("")) {1189 return;1190 }1191 }1192 1186 1193 1187 // Check we have actually been given a .col file. … … 1197 1191 return; 1198 1192 } 1199 1193 1200 1194 // Check that the collection configuration file is available 1201 1195 File collection_file = new File(location); 1202 1196 1203 // Ensure that the directory exists1204 1197 File collection_directory = collection_file.getParentFile(); 1205 1198 String collection_name = collection_directory.getName(); 1199 1200 if (Gatherer.isGsdlRemote) { 1201 if (Gatherer.remoteGreenstoneServer.downloadCollection(collection_name).equals("")) { 1202 return; 1203 } 1204 } 1205 1206 // Ensure that the collection directory exists 1206 1207 if (collection_directory == null || !collection_directory.exists()) { 1207 1208 // We can't open this … … 1244 1245 1245 1246 // Now determine if a lock already exists on this collection. 1246 String collection_name = collection_directory.getName();1247 1247 File lock_file = new File(collection_file.getParentFile(), LOCK_FILE); 1248 1248 if (lock_file.exists()) { … … 1261 1261 1262 1262 lock_file.delete(); 1263 } 1264 1265 // now we are using gli.col - old colls may have used the collection name 1266 if (!collection_file.exists()) { 1267 File old_coll_file = new File(collection_directory, collection_name+".col"); 1268 if (old_coll_file.exists()) { 1269 try { 1270 old_coll_file.renameTo(collection_file); 1271 } catch (Exception e) { 1272 DebugStream.println("Couldn't rename "+old_coll_file.getName()+" to gli.col. Will just carry on with default gli.col"); 1273 // but just carry on. 1274 } 1275 } 1263 1276 } 1264 1277 … … 1283 1296 } 1284 1297 1285 if (canDoScheduling()) { 1286 //THIS LOOKS LIKE THE BEST PLACE TO TRY AND UPDATE .col FILES FOR EXISTING COLLECTIONS...Wendy 1287 1298 // need to fix this up as currently it craps out if the .col file is not there, which is may not always be. 1299 if (canDoScheduling() && collection_file.exists()) { 1300 //THIS LOOKS LIKE THE BEST PLACE TO TRY AND UPDATE .col FILES FOR EXISTING COLLECTIONS...Wendy 1301 // Don't need to update anything if collection_file doesn't exist yet. 1288 1302 //First, see if "Schedule" exists in the XMl File... 1289 1303 BufferedReader bir = new BufferedReader(new FileReader(collection_file));
Note:
See TracChangeset
for help on using the changeset viewer.