|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.openedit.util.URLUtilities
public class URLUtilities
Utility class for building URLs.
| Field Summary | |
|---|---|
static java.lang.String |
URL_PATH_SEPARATOR
The URL path separator. |
| Constructor Summary | |
|---|---|
URLUtilities(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
|
| Method Summary | |
|---|---|
java.lang.String |
buildAppRoot()
This is the server name and webapp returns http://www.acme.com/webapp |
java.lang.String |
buildBasePath(java.lang.String path)
This includes the webapp name but not the page name |
java.lang.String |
buildRoot()
This is the server name only returns http://www.acme.com/ |
java.lang.String |
buildSecure(java.lang.String path)
Build an HTTPS (Secure Socket Layer) method relative to the application context using the given path. |
java.lang.String |
buildSecure(java.lang.String path,
int port)
Build an HTTPS (Secure Socket Layer) method relative to the application context using the given path. |
java.lang.String |
buildStandard(java.lang.String path)
Build an HTTP URL relative to the application context using the given path. |
java.lang.String |
buildStandard(java.lang.String path,
int port)
Build an HTTP URL relative to the application context using the given path. |
java.lang.String |
decode(java.lang.String s)
|
java.lang.String |
encode(java.lang.String s)
Percent-encode the given String. |
java.lang.String |
getOriginalPath()
This is the path that the browser is on. |
java.lang.String |
getOriginalUrl()
Build an HTTP URL relative to the application context using the given path. |
PathUtilities |
getPathUtilities()
|
static java.lang.String |
getPathWithoutContext(java.lang.String inContext,
java.lang.String fullpath,
java.lang.String inDefault)
The only non-buggy way to get a file name is to look at the full URL then chop off the context to make it a relative URL |
javax.servlet.http.HttpServletRequest |
getRequest()
|
javax.servlet.http.HttpServletResponse |
getResponse()
|
java.lang.String |
relativeHomePrefix()
If I am located in /webapp/demo/test.html my prefix would be /demo/ to get back to the base /webapp level The rule is you can tack on $home + "/somepage.html" without getting //somepage.html |
java.lang.String |
requestPath()
Build an HTTP URL relative to the application context using the given path. |
java.lang.String |
requestPathWithArguments()
Is the full path with arguments included /webappname/sub/index.html?test=1234 |
java.lang.String |
requestPathWithArgumentsNoContext()
Is the full path with arguments included /sub/index.html?test=1234 |
void |
setRequest(javax.servlet.http.HttpServletRequest inRequest)
|
void |
setResponse(javax.servlet.http.HttpServletResponse inResponse)
|
java.lang.String |
siteRoot()
Report the site name, e.g. |
static java.lang.String |
textEscape(java.lang.String inStr)
|
static java.lang.String |
xmlEscape(java.lang.String inStr)
A simple hack to escape XML, stolen from Jakarta commons XmlUtils |
static java.lang.String |
xmlEscapeWithWrap(java.lang.String inStr)
|
static java.lang.String |
xmlEscapeWithWrap(java.lang.String inStr,
int inWrap)
|
static java.lang.String |
xmlUnescape(java.lang.String inStr)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String URL_PATH_SEPARATOR
| Constructor Detail |
|---|
public URLUtilities(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
| Method Detail |
|---|
public static java.lang.String getPathWithoutContext(java.lang.String inContext,
java.lang.String fullpath,
java.lang.String inDefault)
public java.lang.String buildBasePath(java.lang.String path)
public java.lang.String buildRoot()
public java.lang.String buildAppRoot()
public java.lang.String buildSecure(java.lang.String path)
public java.lang.String buildSecure(java.lang.String path,
int port)
buildSecure method allows you to specify the
port number. A port number of 0 will cause the port argument to be ignored.
path - The pathport - The port
public java.lang.String buildStandard(java.lang.String path)
path - The path
public java.lang.String buildStandard(java.lang.String path,
int port)
buildStandard method allows you to specify the port number. A port
number of 0 will cause the port argument to be ignored.
path - The pathport - The port
public java.lang.String encode(java.lang.String s)
s - The String to encode
URLEncoderpublic java.lang.String decode(java.lang.String s)
public java.lang.String getOriginalUrl()
public java.lang.String getOriginalPath()
public java.lang.String requestPath()
public java.lang.String requestPathWithArguments()
public java.lang.String requestPathWithArgumentsNoContext()
public java.lang.String siteRoot()
public static java.lang.String xmlEscapeWithWrap(java.lang.String inStr)
public static java.lang.String xmlEscapeWithWrap(java.lang.String inStr,
int inWrap)
public static java.lang.String xmlEscape(java.lang.String inStr)
inStr -
public static java.lang.String textEscape(java.lang.String inStr)
public static java.lang.String xmlUnescape(java.lang.String inStr)
public java.lang.String relativeHomePrefix()
public PathUtilities getPathUtilities()
public javax.servlet.http.HttpServletResponse getResponse()
public void setResponse(javax.servlet.http.HttpServletResponse inResponse)
public javax.servlet.http.HttpServletRequest getRequest()
public void setRequest(javax.servlet.http.HttpServletRequest inRequest)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||