Ignore:
Timestamp:
2018-08-22T22:08:05+12:00 (6 years ago)
Author:
ak19
Message:

GS3 Java code has moved away from using tomcat.port to using tomcat.port.<protocol>.

File:
1 edited

Legend:

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

    r28959 r32357  
    2929import java.net.URLConnection;
    3030import java.util.Properties;
     31
     32import org.greenstone.util.ProtocolPortProperties;
    3133
    3234/**
     
    8688        // get the property value and print it out
    8789        String servername = buildProps.getProperty("tomcat.server");
    88         String port = buildProps.getProperty("tomcat.port");
     90        //String protocol = buildProps.getProperty("server.protocol", "http");
     91        //String port = buildProps.getProperty("tomcat.port"+protocol, "8383");
     92       
     93        ProtocolPortProperties protocolPortProps = new ProtocolPortProperties(buildProps);
     94        if(protocolPortProps.hadError()) {
     95            throw new Exception("**** ERROR with port and/or protocol in build.properties:\n" + protocolPortProps.getErrorMsg());
     96        }
     97        String protocol = protocolPortProps.getProtocol();
     98        String port = protocolPortProps.getPort();
    8999        int portNum = Integer.parseInt(port);
    90100       
     
    94104            urlSuffix = urlSuffix + "&col="+collection;
    95105        }
    96         URL authenticationUrl = new URL("http", servername, portNum, urlSuffix);
     106        URL authenticationUrl = new URL(protocol, servername, portNum, urlSuffix);
    97107       
    98108        HttpURLConnection conn = (HttpURLConnection)authenticationUrl.openConnection();     
     
    120130        System.out.print(result); // don't add newline to end
    121131       
    122     } catch (IOException ex) {
     132    } catch (Exception ex) {
    123133        ex.printStackTrace();
    124134    } finally {
Note: See TracChangeset for help on using the changeset viewer.