Changeset 22366


Ignore:
Timestamp:
07/07/10 16:09:28 (11 years ago)
Author:
ak19
Message:

Fixed GS3 host and port used for testing connecting to Fedora now replaced with reading these values from global.properties

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/FedoraServiceProxy.java

    r22319 r22366  
    4141import java.io.File;
    4242import java.util.HashMap;
     43import java.util.Locale;
     44import java.util.Properties;
    4345import java.util.ResourceBundle;
    44 import java.util.Locale;
    4546import java.lang.reflect.Method;
    4647
     
    111112        //final File propertiesFile = new File("gs3fedora.properties");
    112113        //fedoraServicesAPIA = new FedoraServicesAPIA(propertiesFile);
    113 
    114         fedoraServicesAPIA = new FedoraServicesAPIA("http", "localhost", 8383, "fedoraIntCallUser", "changeme");//"fedoraAdmin", "pounamu"
     114       
     115        // Defaults. Read host and port from global.properties
     116        Properties globalProperties = new Properties();
     117        globalProperties.load(Class.forName("org.greenstone.util.GlobalProperties").getClassLoader().getResourceAsStream("global.properties"));
     118        String host = globalProperties.getProperty("tomcat.server", "localhost");
     119        String port = globalProperties.getProperty("tomcat.port", "8383");
     120        String protocol = "http";
     121        String username = "fedoraIntCallUser"; //"fedoraAdmin"
     122        String password = "changeme"; //"pounamu"
     123
     124        fedoraServicesAPIA = new FedoraServicesAPIA(protocol, host, Integer.parseInt(port), username, password); //"fedoraAdmin", "pounamu"
    115125    } catch(org.greenstone.fedora.services.FedoraGS3Exception.CancelledException e) {
    116126        // The user pressed cancel in the fedora services instantiation dlg
Note: See TracChangeset for help on using the changeset viewer.