Changeset 37330
- Timestamp:
- 2023-02-19T23:52:08+13:00 (4 weeks ago)
- Location:
- main/trunk/gli
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r37328 r37330 170 170 static private URL default_gliserver_url=null; 171 171 172 public Gatherer( String[] args)172 public Gatherer(GetOpt go) 173 173 { 174 174 // Display the version to make error reports a lot more useful … … 177 177 JarTools.initialise(this); 178 178 179 GetOpt go = new GetOpt(args);179 //GetOpt go = new GetOpt(args); 180 180 181 181 // Remember the GSDLOS value … … 246 246 } 247 247 else if (isWebswing) { 248 Configuration.template_config_xml = Configuration.TEMPLATE_CONFIG_PREFIX + Configuration.CONFIG_WEBSWING_XML; 248 249 Configuration.config_xml = Configuration.CONFIG_WEBSWING_XML; 249 250 } … … 266 267 } 267 268 269 public Gatherer(String[] args) 270 { 271 this(new GetOpt(args)); 272 } 268 273 269 274 public void init(String gsdl_path, String gsdl3_path, String gsdl3_src_path, … … 287 292 System.exit(0); 288 293 } 294 295 String username = webswingAuthenticator.getUsername(); 296 297 // In webswing case, GathererProg does not have a username when it was initializing this 298 String gli_no_username_dir_path = Gatherer.getGLIUserDirectoryPath(); 299 300 String gli_user_directory_path = gli_no_username_dir_path + username + File.separator; 301 302 File gli_user_directory = new File(gli_user_directory_path); 303 if (!gli_user_directory.exists() && !gli_user_directory.mkdir()) { 304 System.err.println("Warning: Unable to make directory: " + gli_user_directory_path); 305 } 306 else { 307 Gatherer.setGLIUserDirectoryPath(gli_user_directory_path); 308 } 309 289 310 } 290 311 // Create the debug stream if required … … 1976 1997 } 1977 1998 1999 public String getUsername() { 2000 return username; 2001 } 2002 2003 1978 2004 public boolean authenticate(String library_url_string) { 1979 2005 PasswordAuthentication pa = getPasswordAuthentication(); -
main/trunk/gli/src/org/greenstone/gatherer/GathererProg.java
r32926 r37330 61 61 } 62 62 63 GetOpt go = new GetOpt(args); 64 63 65 // Determine the GLI user directory path 64 String gli_user_directory_path = System.getProperty("user.home") + File.separator; 65 if (Utility.isWindows()) { 66 gli_user_directory_path += "Application Data" + File.separator + "Greenstone" + File.separator + "GLI" + File.separator; 67 } 68 else { 69 gli_user_directory_path += ".gli" + File.separator; 70 } 66 String gli_user_directory_path = null; 67 if (go.webswing) { 68 if (go.gsdl3_src_path != null) { 69 // above is a (albeit a crude) test at this early stage of running, 70 // that makes sure we're running GS3 71 72 // "user.dir" resolves to the user's current-working-directory 73 // which is engineered through webswing.config to be the GLI home directory 74 75 gli_user_directory_path = System.getProperty("user.dir") + File.separator + "webswing-users" + File.separator; 76 77 //gli_user_directory_path = go.gsdl3_src_path + File.separator; 78 79 // or GSDL3SRCHOME ??? 80 //gli_user_directory_path = System.getProperty("user.dir") + File.separator; 81 //gli_user_directory_path = System.getenv("GSDL3SRCHOME") + File.separator; 82 83 File gli_user_directory = new File(gli_user_directory_path); 84 85 if (!gli_user_directory.exists() && !gli_user_directory.mkdir()) { 86 System.err.println("Warning: Unable to make directory: " + gli_user_directory_path); 87 } 88 } 89 else { 90 System.err.println("Webswing for Greenstone2 not supported"); 91 System.exit(1); 92 } 93 } 94 else { 95 gli_user_directory_path = System.getProperty("user.home") + File.separator; 96 97 98 if (Utility.isWindows()) { 99 gli_user_directory_path += "Application Data" + File.separator + "Greenstone" + File.separator + "GLI" + File.separator; 100 } 101 else { 102 gli_user_directory_path += ".gli" + File.separator; 103 } 104 } 105 71 106 Gatherer.setGLIUserDirectoryPath(gli_user_directory_path); 72 107 … … 75 110 76 111 // Create an instance of the Gatherer class, which will parse the args and prepare the rest of the GLI 77 final Gatherer gatherer = new Gatherer( args);112 final Gatherer gatherer = new Gatherer(go); 78 113 79 114 // TESTING circumventing the old GUI event dispatch thread exceptions in GLI. Follows
Note:
See TracChangeset
for help on using the changeset viewer.