Changeset 4302
- Timestamp:
- 2003-05-23T16:12:49+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Configuration.java
r4293 r4302 55 55 public class Configuration 56 56 extends Hashtable { 57 public File exec_file; 57 58 /** The path (or url) to the webserver which is serving the Greenstone collection. */ 58 59 public String exec_path = null; … … 73 74 private int cache_hit = 0; 74 75 private int cache_miss = 0; 75 p rivateURL exec_address = null;76 public URL exec_address = null; 76 77 /** The string identifying an argument's name attribute. */ 77 78 static final private String ARGUMENT_NAME = "name"; … … 103 104 this.gsdl_path = gsdl_path; 104 105 this.exec_path = exec_path; 106 // The exec_path may contain an url address, in which case we blindly use that and leave it up to the user to worry about settings and resetting. 107 System.err.println("EXEC_PATH = " + exec_path); 108 if(exec_path != null && exec_path.length() > 0) { 109 try { 110 // If its missing the protocol add it now. 111 if(exec_path.indexOf("://") != -1) { 112 exec_address = new URL(exec_path); 113 } 114 else { 115 exec_address = new URL("http://" + exec_path); 116 } 117 } 118 catch (MalformedURLException error) { 119 System.err.println("Not an address."); 120 } 121 } 122 // If the above failed, then its up to us to try and figure out what to do. 123 if(exec_address == null) { 124 // Try building a file from the given exec_path 125 try { 126 File local_file = new File(exec_path); 127 if(local_file.exists()) { 128 // All good. I hope. 129 exec_file = local_file; 130 } 131 } 132 // All sorts of errors might be thrown by a bogus file path. 133 catch (Exception error) { 134 System.err.println("Not a valid file."); 135 } 136 // We can generate the path to where the local library should be and use that if it is there. 137 if(exec_file == null) { 138 File server_exe = new File(gsdl_path + Utility.SERVER_EXE); 139 if(server_exe.exists()) { 140 exec_file = server_exe; 141 } 142 else { 143 System.err.println("No local library."); 144 } 145 } 146 // If we get to here with no exec_address nor an exec_file its just plain not going to work. 147 } 105 148 this.perl_path = perl_path; 106 149 // Ensure the perl path includes exe under windoze
Note:
See TracChangeset
for help on using the changeset viewer.