public abstract class BaseURI extends Object implements URI, URIConstants
CGI_ACTION_PARAM, CGI_SCREEN_PARAM, CGI_TEMPLATE_PARAM, EVENT_PREFIX, FTP_PORT, HTTP, HTTP_PORT, HTTPS, HTTPS_PORT, PATH_INFO, QUERY_DATA, URI_SCHEME_SEPARATOR| Constructor and Description |
|---|
BaseURI()
Empty C'tor.
|
BaseURI(RunData runData)
Constructor with a RunData object
|
BaseURI(RunData runData,
boolean redirect)
Constructor, set explicit redirection
|
BaseURI(ServerData serverData)
Constructor with a ServerData object
|
BaseURI(ServerData serverData,
boolean redirect)
Constructor, set explicit redirection
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
encodeResponse(String uri)
Encodes a Response Uri according to the Servlet Container.
|
protected void |
getContextAndScript(StringBuilder sb)
Append the Context Path and Script Name to the passed
String Buffer.
|
String |
getContextPath()
Gets the context path.
|
String |
getReference()
Returns the current reference anchor.
|
protected javax.servlet.http.HttpServletResponse |
getResponse()
Returns the Response Object from the Servlet Container.
|
protected void |
getSchemeAndPort(StringBuilder sb)
Appends Scheme, Server and optionally the port to the
supplied String Buffer.
|
String |
getScriptName()
Gets the script name (/servlets/Turbine).
|
String |
getServerName()
Gets the server name.
|
int |
getServerPort()
Gets the server port.
|
String |
getServerScheme()
Returns the current Server Scheme
|
boolean |
hasReference()
Does this URI contain an anchor?
|
boolean |
isRedirect()
Returns the current value of the Redirect flag
|
void |
setContextPath(String contextPath)
Sets the context path.
|
void |
setRedirect(boolean redirect)
Set the redirect Flag
|
void |
setReference(String reference)
Sets a reference anchor (#ref).
|
protected void |
setResponse(javax.servlet.http.HttpServletResponse response)
Set a Response Object to use when creating the
response string.
|
void |
setScriptName(String scriptName)
Sets the script name (/servlets/Turbine).
|
void |
setSecure()
Method to specify that a URI should use SSL.
|
void |
setSecure(int port)
Method to specify that a URI should use SSL.
|
void |
setServerName(String serverName)
Sets the server name.
|
void |
setServerPort(int serverPort)
Sets the server port.
|
void |
setServerScheme(String serverScheme)
Sets the scheme (HTTP or HTTPS).
|
public BaseURI()
public BaseURI(RunData runData)
runData - A RunData objectpublic BaseURI(RunData runData, boolean redirect)
runData - A RunData objectredirect - True if redirection allowed.public BaseURI(ServerData serverData)
serverData - A ServerData objectpublic BaseURI(ServerData serverData, boolean redirect)
serverData - A ServerData objectredirect - True if redirection allowed.public void setRedirect(boolean redirect)
redirect - The new value of the redirect flag.public boolean isRedirect()
public String getScriptName()
getScriptName in interface URIpublic void setScriptName(String scriptName)
scriptName - A String with the script name.public String getContextPath()
getContextPath in interface URIpublic void setContextPath(String contextPath)
contextPath - A String with the context pathpublic String getServerName()
getServerName in interface URIpublic void setServerName(String serverName)
serverName - A String with the server name.public int getServerPort()
getServerPort in interface URIpublic void setServerPort(int serverPort)
serverPort - An int with the port.public void setSecure()
public void setSecure(int port)
port - An int with the port number.public void setServerScheme(String serverScheme)
serverScheme - A String with the scheme.public String getServerScheme()
getServerScheme in interface URIpublic void setReference(String reference)
reference - A String containing the reference.public String getReference()
getReference in interface URIpublic boolean hasReference()
protected void setResponse(javax.servlet.http.HttpServletResponse response)
protected javax.servlet.http.HttpServletResponse getResponse()
protected void getContextAndScript(StringBuilder sb)
This is a convenience method to be used in the Link output routines of derived classes to easily append the correct path.
sb - The StringBuilder to store context path and script name.protected void getSchemeAndPort(StringBuilder sb)
This is a convenience method to be used in the Link output routines of derived classes to easily append the correct server scheme.
sb - The StringBuilder to store the scheme and port information.protected String encodeResponse(String uri)
uri - The Uri to encodeCopyright © 2000–2018 The Apache Software Foundation. All rights reserved.