Changeset 32335 for main/trunk
- Timestamp:
- 2018-08-14T16:29:38+12:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/util/GlobalProperties.java
r32334 r32335 153 153 154 154 //protocol 155 if (properties.getProperty("server.protocol") == null || properties.getProperty("server.protocol").equals("")) 155 protocolSpecifier = properties.getProperty("server.protocol"); 156 if (protocolSpecifier == null || protocolSpecifier.equals("")) 156 157 { 157 158 protocolSpecifier = "http://"; 158 159 } 160 else if (!protocolSpecifier.endsWith("://")) 161 { 162 protocolSpecifier = protocolSpecifier + "://"; 163 } 164 165 //hostname 166 hostSpecifier = properties.getProperty("tomcat.server"); 167 if (hostSpecifier == null) 168 { 169 hostSpecifier = "localhost"; 170 } 159 171 else 160 { 161 if (properties.getProperty("server.protocol").endsWith("://")) 162 { 163 protocolSpecifier = properties.getProperty("server.protocol"); 164 } 165 else 166 { 167 protocolSpecifier = properties.getProperty("server.protocol") + "://"; 168 } 169 } 170 171 //hostname 172 if (properties.getProperty("tomcat.server") == null) 173 { 174 hostSpecifier = "localhost"; 175 } 176 else 177 { 178 hostSpecifier = properties.getProperty("tomcat.server"); 172 { 179 173 while (hostSpecifier.endsWith("/")) 180 174 { … … 184 178 185 179 //port 186 if (properties.getProperty("tomcat.port") == null || properties.getProperty("tomcat.port").equals("") || (protocolSpecifier.equals("http://") && properties.getProperty("tomcat.port").equals("80")) || (protocolSpecifier.equals("https://") && properties.getProperty("tomcat.port").equals("443"))) 180 portSpecifier = properties.getProperty("tomcat.port"); 181 if (portSpecifier == null || portSpecifier.equals("") 182 || (protocolSpecifier.equals("http://") && portSpecifier.equals("80")) 183 || (protocolSpecifier.equals("https://") && portSpecifier.equals("443"))) 187 184 { 188 185 portSpecifier = ""; … … 190 187 else 191 188 { 192 portSpecifier = ":" + p roperties.getProperty("tomcat.port");189 portSpecifier = ":" + portSpecifier; 193 190 } 194 191 195 192 //context path 196 if (properties.getProperty("tomcat.context") == null || properties.getProperty("tomcat.context").equals("") || properties.getProperty("tomcat.context").equals("/")) 193 contextSpecifier = properties.getProperty("tomcat.context"); 194 if (contextPath == null || contextPath.equals("") || contextPath.equals("/")) 197 195 { 198 196 contextSpecifier = ""; 199 197 } 200 198 else 201 { 202 contextSpecifier = properties.getProperty("tomcat.context"); 199 { 203 200 if (!contextSpecifier.startsWith("/")) 204 201 {
Note:
See TracChangeset
for help on using the changeset viewer.