- Timestamp:
- 2009-06-08T15:16:34+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/greenstone/LocalLibraryServer.java
r19585 r19758 162 162 } 163 163 164 static public voidstart(String gsdl_path, String local_library_server_file_path)164 static public boolean start(String gsdl_path, String local_library_server_file_path) 165 165 { 166 // Check the local library server file (server.exe or gs2-server.sh) exists167 local_library_server_file = new File(local_library_server_file_path);168 169 if (!local_library_server_file.exists()) {170 DebugStream.println("No local library at given file path.");171 172 String defaultServerFilename = Utility.isWindows() ? "server.exe" : "gs2-server.sh";173 local_library_server_file = new File(gsdl_path + defaultServerFilename);174 if (!local_library_server_file.exists()) {175 DebugStream.println("No local library at all.");176 return;177 }178 }179 180 166 // In the case of the Local Library Server on Linux, we need to do an extra test: 181 167 // If GS2 was not configured with --enable-apache-httpd, then there is no apache webserver folder, … … 187 173 DebugStream.println("The web server does not exist at " 188 174 + localLinuxServerFolder.getAbsolutePath() + "\nNo local library at all. Trying web library"); 189 return; 190 } 191 } 175 return false; 176 } 177 } 178 179 // Check the local library server file (server.exe or gs2-server.sh) exists 180 if(local_library_server_file_path == null) { 181 return false; 182 } 183 local_library_server_file = new File(local_library_server_file_path); 184 if (!local_library_server_file.exists()) { 185 DebugStream.println("No local library at given file path."); 186 187 String defaultServerFilename = Utility.isWindows() ? "server.exe" : "gs2-server.sh"; 188 local_library_server_file = new File(gsdl_path + defaultServerFilename); 189 if (!local_library_server_file.exists()) { 190 DebugStream.println("No local library at all."); 191 return false; 192 } 193 } 192 194 193 195 llssite_cfg_file = new LLSSiteConfig(local_library_server_file); 194 196 if(!llssite_cfg_file.isConfigFileSet()) { 197 return false; 198 } 199 200 // from now on return true: we're in local_library_mode (even if the server is not running) 201 202 195 203 // If the user launched the GSI independent of GLI, but user has not pressed 196 204 // Enter Library yet, then we will obtain the previewURL later. 197 205 if(LocalLibraryServer.isURLPending()) { 198 206 // running is still false when the URL is pending because only GSI is running, not the server 199 return ;207 return true; 200 208 } else if(llssite_cfg_file.isIndependentGSI()) { 201 209 // there is a url, it's not pending, and it is llssite.cfg: meaning GSI has started up 202 210 running = true; 203 return ;211 return true; 204 212 } 205 213 … … 219 227 // Run the server interface 220 228 Gatherer.spawnApplication(local_library_server_command, ID); 221 return ;229 return true; 222 230 } 223 231 catch (MalformedURLException exception) { … … 250 258 } 251 259 } 260 261 return true; 252 262 } 253 263 … … 584 594 lastModified = configFile.lastModified(); 585 595 return true; 596 } 597 598 /** To test we've actually instantiated this object meaningfully. If so, then configFile is set */ 599 public boolean isConfigFileSet() { 600 return (configFile != null && configFile.exists()); 586 601 } 587 602
Note:
See TracChangeset
for help on using the changeset viewer.