Changeset 25718

Show
Ignore:
Timestamp:
31.05.2012 10:07:12 (7 years ago)
Author:
kjdon
Message:

sometimes gsdl3_home is null, eg when called from Server3, so don't try and get a new File if it is null.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/util/GlobalProperties.java

    r25717 r25718  
    8080            if (in != null) 
    8181            { 
    82                 logger.debug("loading global properties"); 
     82                    logger.debug("loading global properties"); 
    8383                properties.load(in); 
    8484                in.close(); 
     
    9696 
    9797            // make sure the path separators are correct 
    98             File gs3_file = new File(gsdl3_home); 
    99             gsdl3_home = gs3_file.getPath(); 
    100  
     98            // gsdl3_home may be null, eg when we are loading properties from Server3 
     99            if (gsdl3_home != null) { 
     100              File gs3_file = new File(gsdl3_home); 
     101              gsdl3_home = gs3_file.getPath(); 
     102            } 
    101103            //build the gsdl3 web address, in a way resilient to errors and ommisions in global.properties, simplifying where possible 
    102104            //aiming for a string with no trailing slash, eg "http://localhost:8080/greenstone3" or "http://www.mygreenstonelibrary.com" 
     
    165167        { 
    166168            logger.error("Exception trying to reload global.properties: " + e); 
     169            e.printStackTrace(); 
    167170        } 
    168171    }