Package org.apache.turbine.util
Class ServerData
- java.lang.Object
-
- org.apache.turbine.util.ServerData
-
public class ServerData extends Object
Holds basic server information under which Turbine is running. This class is accessable via the RunData object within the Turbine system. You can also use it as a placeholder for this information if you are only emulating a servlet system.- Version:
- $Id$
- Author:
- Kevin A. Burton, Jon S. Stevens, Henning P. Schmiedehausen
-
-
Constructor Summary
Constructors Constructor Description ServerData(String serverName, int serverPort, String serverScheme, String scriptName, String contextPath)Constructor.ServerData(HttpServletRequest req)A C'tor that takes a HTTP Request object and builds the server data from its contentsServerData(ServerData serverData)Copy-Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()generates a new Object with the same values as this one.StringgetContextPath()Get the context path.voidgetHostUrl(StringBuilder url)Appends the Host URL to the supplied StringBuilder.StringgetScriptName()Get the script nameStringgetServerName()Get the name of the server.intgetServerPort()Get the server port.StringgetServerScheme()Get the server scheme.voidsetContextPath(String contextPath)Set the context path.voidsetScriptName(String scriptName)Set the script name.voidsetServerName(String serverName)Sets the cached serverName.voidsetServerPort(int serverPort)Sets the cached serverPort.voidsetServerScheme(String serverScheme)Sets the cached serverScheme.StringtoString()Returns this object as an URL.
-
-
-
Constructor Detail
-
ServerData
public ServerData(String serverName, int serverPort, String serverScheme, String scriptName, String contextPath)
Constructor.- Parameters:
serverName- The server name.serverPort- The server port.serverScheme- The server scheme.scriptName- The script name.contextPath- The context Path
-
ServerData
public ServerData(ServerData serverData)
Copy-Constructor- Parameters:
serverData- A ServerData Object
-
ServerData
public ServerData(HttpServletRequest req)
A C'tor that takes a HTTP Request object and builds the server data from its contents- Parameters:
req- The HTTP Request
-
-
Method Detail
-
getServerName
public String getServerName()
Get the name of the server.- Returns:
- A String.
-
setServerName
public void setServerName(String serverName)
Sets the cached serverName.- Parameters:
serverName- the server name.
-
getServerPort
public int getServerPort()
Get the server port.- Returns:
- the server port.
-
setServerPort
public void setServerPort(int serverPort)
Sets the cached serverPort.- Parameters:
serverPort- the server port.
-
getServerScheme
public String getServerScheme()
Get the server scheme.- Returns:
- the server scheme.
-
setServerScheme
public void setServerScheme(String serverScheme)
Sets the cached serverScheme.- Parameters:
serverScheme- the server scheme.
-
getScriptName
public String getScriptName()
Get the script name- Returns:
- the script name.
-
setScriptName
public void setScriptName(String scriptName)
Set the script name.- Parameters:
scriptName- the script name.
-
getContextPath
public String getContextPath()
Get the context path.- Returns:
- the context path.
-
setContextPath
public void setContextPath(String contextPath)
Set the context path.- Parameters:
contextPath- A String.
-
getHostUrl
public void getHostUrl(StringBuilder url)
Appends the Host URL to the supplied StringBuilder.- Parameters:
url- A StringBuilder object
-
-