Ignore:
Timestamp:
2008-12-08T13:36:13+13:00 (15 years ago)
Author:
ak19
Message:

Now first checks whether glisite.cfg exists and loads that, if not it looks for gsdlsite.cfg and loads that. Previously it would only look for and try to load gsdlsite.cfg, which meant that it ignored any server configuration values I changed in glisite.cfg (like autoenter and startbrowser).

File:
1 edited

Legend:

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

    r13792 r18136  
    139139
    140140    // Configure the server for immediate entry
    141     gsdlsite_cfg_file.set();
     141    //gsdlsite_cfg_file.set();
    142142
    143143    // Spawn local library server process
     
    286286    public GSDLSiteConfig(File server_exe) {
    287287        debug("New GSDLSiteConfig for: " + server_exe.getAbsolutePath());
     288       
    288289        gsdlsite_cfg = new File(server_exe.getParentFile(), GSDLSITE_CFG);
    289290        glisite_cfg = new File(server_exe.getParentFile(), GLISITE_CFG);
     291
     292        File configFile = null;
     293        if(glisite_cfg.exists()) {
     294        configFile = glisite_cfg;
     295        } else if(gsdlsite_cfg.exists()) {
     296        configFile = gsdlsite_cfg;
     297        } else {
     298        debug("Neither the file glisite.cfg nor GSDLsite.cfg can be found!");
     299        }
     300       
    290301        autoenter_initial = null;
    291302        start_browser_initial = null;
    292         if(gsdlsite_cfg.exists()) {
    293         debug("Load: " + gsdlsite_cfg.getAbsolutePath());
     303        if(configFile != null) {
     304        debug("Load: " + configFile.getAbsolutePath());
    294305        clear();
    295306        try {
    296             BufferedReader in = new BufferedReader(new FileReader(gsdlsite_cfg));
     307            BufferedReader in = new BufferedReader(new FileReader(configFile));
    297308            String line = null;
    298309            while((line = in.readLine()) != null) {
     
    315326        }
    316327        }
    317         else {
    318         debug("No GSDLsite.cfg file can be found!");
    319         }
    320     }
    321 
     328    }
     329   
    322330    public boolean exists() {
    323331        return gsdlsite_cfg.exists();
     
    402410        }
    403411        else {
    404         debug("No GSDLsite.cfg file can be found!");
     412        debug("No glisite.cfg file can be found!");
    405413        }
    406414    }
Note: See TracChangeset for help on using the changeset viewer.