Ignore:
Timestamp:
2018-08-31T18:43:12+12:00 (6 years ago)
Author:
ak19
Message:

Next incremental change: now GS3 solr ext java code goes through ProtocolPortProperties.java to obtain the port and protocol. Will hereafter need to make ProtocolPortProperties constructors throw an exception on error and update all code using it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/GS2SolrSearch.java

    r32410 r32411  
    4949import org.greenstone.gsdl3.util.SolrQueryWrapper;
    5050import org.greenstone.util.GlobalProperties;
     51import org.greenstone.util.ProtocolPortProperties;
    5152import org.w3c.dom.Document;
    5253import org.w3c.dom.Element;
     
    9697            globalProperties.load(Class.forName("org.greenstone.util.GlobalProperties").getClassLoader().getResourceAsStream("global.properties"));
    9798            String host = globalProperties.getProperty("tomcat.server", "localhost");
    98             String port = globalProperties.getProperty("tomcat.port.http", "8383");
    99             String protocol = globalProperties.getProperty("server.protocol", "http");
     99            //String port = globalProperties.getProperty("tomcat.port.http", "8383");
     100            //String protocol = globalProperties.getProperty("server.protocol", "http");
     101            ProtocolPortProperties protocolPortProps = new ProtocolPortProperties(globalProperties);
     102            if(protocolPortProps.hadError()) {
     103            throw new Exception("**** ERROR with port and/or protocol in build.properties:\n" + protocolPortProps.getErrorMsg());
     104            }
     105            String protocol = protocolPortProps.getProtocol();
     106            String port = protocolPortProps.getPort();
    100107            String solrContext = globalProperties.getProperty("solr.context", "solr");
    101108           
Note: See TracChangeset for help on using the changeset viewer.