Changeset 22911

Show
Ignore:
Timestamp:
15.09.2010 18:49:33 (9 years ago)
Author:
ak19
Message:

gsdlsite.cfg which gets updated when collectdir is changed may not exist the first time round (like when gs2 is just checked out from svn and you want to change the default collectdir from that of a previous gs2 installation to the new one). But it is the apache web server that needs gsdlsite.cfg (for collecthome), not server.exe.

Location:
main/trunk/gli/src/org/greenstone/gatherer
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java

    r22831 r22911  
    880880            collectDir = collectDir.substring(0, collectDir.length()-1); // remove file separator at end     
    881881            Utility.updatePropertyConfigFile(gsdlsitecfg, "collecthome", collectDir); 
    882  
     882                    // if gsdlsite.cfg does not exist (if using server.exe for instance), the above method will just return 
     883             
    883884            if(!Gatherer.GS3 && Gatherer.isLocalLibrary) { 
    884885                // for Images in the collection to work, the apache web server  
  • main/trunk/gli/src/org/greenstone/gatherer/greenstone/LocalLibraryServer.java

    r22806 r22911  
    729729                    + "cgi-bin" + File.separator + "gsdlsite.cfg"; 
    730730                Utility.updatePropertyConfigFile(gsdlsitecfg, "collecthome", collectDir); // no file separator at end 
     731                    // if gsdlsite.cfg does not exist (if using server.exe for instance), the above method will just return 
    731732            } 
    732733             
  • main/trunk/gli/src/org/greenstone/gatherer/util/Utility.java

    r22605 r22911  
    470470     */ 
    471471    public static void updatePropertyConfigFile(String filename, String propertyName, String propertyValue) { 
     472    File propFile = new File(filename); 
     473    if(!propFile.exists()) { 
     474        System.err.println("*** Unable to update property " + propertyName + " in file "  
     475                + filename + "to\n" + propertyValue + ". File does not exist.\n"); 
     476        return; 
     477    }    
    472478    BufferedReader fin = null; 
    473479    BufferedWriter fout = null;