Package org.codice.ddf.configuration
Class SystemBaseUrl
java.lang.Object
org.codice.ddf.configuration.SystemBaseUrl
An immutable utility class for getting system url information. Information is pulled from the
system properties.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final SystemBaseUrlstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final SystemBaseUrlstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionconstructUrl(String context) Construct a url for the given contextconstructUrl(String context, boolean includeRootContext) Construct a url for the given contextconstructUrl(String proto, String context) Construct a url based on the protocol and contextconstructUrl(String proto, String context, boolean includeRootContext) Construct a url based on the protocol and contextConstructs and returns the base url for the system using the system default protocolgetBaseUrl(String proto) Constructs and returns the base url for the system given a protocolgetHost()Gets the current host name or IP address from the system properties, orDEFAULT_HOSTif not set.getPort()Gets the port number based on the the system protocolGets the port number for the given protocol.
-
Field Details
-
INTERNAL_HTTP_PORT
- See Also:
-
INTERNAL_HTTPS_PORT
- See Also:
-
INTERNAL_PORT
- See Also:
-
INTERNAL_HOST
- See Also:
-
INTERNAL_PROTOCOL
- See Also:
-
INTERNAL_ROOT_CONTEXT
- See Also:
-
EXTERNAL_HTTP_PORT
- See Also:
-
EXTERNAL_HTTPS_PORT
- See Also:
-
EXTERNAL_PORT
- See Also:
-
EXTERNAL_HOST
- See Also:
-
EXTERNAL_PROTOCOL
- See Also:
-
EXTERNAL_CONTEXT
- See Also:
-
DEFAULT_HTTP_PORT
- See Also:
-
DEFAULT_HTTPS_PORT
- See Also:
-
DEFAULT_HOST
- See Also:
-
DEFAULT_PROTOCOL
- See Also:
-
EXTERNAL
-
INTERNAL
-
-
Method Details
-
getPort
Gets the port number based on the the system protocol- Returns:
-
getBaseUrl
Constructs and returns the base url for the system using the system default protocol- Returns:
-
getBaseUrl
Constructs and returns the base url for the system given a protocol- Parameters:
proto- Protocol to use during url construction. A null value will cause the system default protocol to be used- Returns:
-
constructUrl
Construct a url for the given context- Parameters:
context- The context path to be appened to the end of the base url- Returns:
-
constructUrl
Construct a url for the given context- Parameters:
context- The context path to be appened to the end of the base urlincludeRootContext- Flag to indicated whether the rootcontext should be included in the url.- Returns:
-
constructUrl
Construct a url based on the protocol and context- Parameters:
proto- Protocol to use during url construction. A null value will cause the system default protocol to be usedcontext- The context path to be appened to the end of the base url- Returns:
-
constructUrl
Construct a url based on the protocol and context- Parameters:
proto- Protocol to use during url construction. A null value will cause the system default protocol to be usedcontext- The context path to be appened to the end of the base urlincludeRootContext- Flag to indicated whether the rootcontext should be included in the url.- Returns:
-
getPort
Gets the port number for the given protocol. If the protocol is null or not one of http or https returns the https port number.- Parameters:
proto- protocol (http or https)- Returns:
-
getHttpPort
-
getHttpsPort
-
getHost
Gets the current host name or IP address from the system properties, orDEFAULT_HOSTif not set.- Returns:
- host name, IP address or
DEFAULT_HOST
-
getProtocol
-
getRootContext
-