- Timestamp:
- 2010-08-24T19:49:00+12:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/greenstone/LocalLibraryServer.java
r22678 r22771 162 162 } 163 163 164 164 /** collection name can be a group-qualified collect name */ 165 165 static public void releaseCollection(String collection_name) 166 166 { … … 693 693 useGLISiteCfg(server_exe); 694 694 } 695 696 // We're in the constructor, so we'll be running the LLS the first time, if we're 697 // running *server.exe* and if the current collect dir at Local Lib's startup is 698 // anything other than the default GS collect dir, then use that: 699 if (isPersistentServer) { // server.exe, so we're dealing with a local GS2 700 String collectDir = Configuration.getString("general.open_collection_gs2", true); 701 702 // If opening a collection outside the standard GS collect folder, need 703 // to open the non-standard collect folder that the collection resides in 704 if (!collectDir.startsWith(Gatherer.getDefaultGSCollectDirectoryPath())) { 705 File collectFolder = null; 706 if(!collectDir.endsWith("gli.col")) { // then it's a collect folder 707 collectFolder = new File(collectDir); 708 } else { 709 // the filepath is a gli.col file. To get the collect folder: the 1st level 710 // up is collection folder, 2 two levels up is the containing collect folder 711 collectFolder = new File(collectDir).getParentFile().getParentFile(); 712 } 713 714 // Need to deal with colgroups as well: while there's an etc/collect.cfg in the current 715 // collectFolder, move one level up 716 if(new File(collectFolder.getAbsolutePath()+File.separator+Utility.CONFIG_FILE).exists()) { 717 collectFolder = collectFolder.getParentFile(); 718 } 719 collectDir = collectFolder.getAbsolutePath(); 720 721 // write out the non-standard collectDir (minus file separator at end) to the lls site conf 722 // file being used 723 if(collectDir.endsWith(File.separator)) { 724 collectDir = collectDir.substring(0, collectDir.length()); 725 } 726 put(COLLECTHOME, collectDir); 727 save(); 728 lastModified = configFile.lastModified(); 729 } 730 } // now the correct current collect dir will get loaded when the server is started up hereafter 695 731 } 696 732 … … 976 1012 977 1013 // write out the line 978 out.write(line + "\n"); 1014 out.write(line); 1015 out.newLine(); 979 1016 } 980 1017
Note:
See TracChangeset
for help on using the changeset viewer.