|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.net.NetTools
public final class NetTools
Utilities for net access.
Nested Class Summary | |
---|---|
static class |
NetTools.HttpInputStream
|
Method Summary | |
---|---|
static void |
appendRootRelativeURL(java.lang.Appendable a,
javax.servlet.http.HttpServletRequest req,
java.lang.String rurl)
Constructs an URL that is relative to the root of the server from an application-root based URL. |
static java.lang.String |
getApplicationContext(javax.servlet.http.HttpServletRequest req)
This returns the application's context path without any slashes!!. |
static java.lang.String |
getApplicationURL(javax.servlet.http.HttpServletRequest req)
Returns the URL to the root of the application. |
static java.lang.String |
getHostName(javax.servlet.http.HttpServletRequest req)
|
static int |
getHostPort(javax.servlet.http.HttpServletRequest req)
|
static java.lang.String |
getHostURL(javax.servlet.http.HttpServletRequest req)
|
static void |
getHostURL(java.lang.StringBuffer sb,
javax.servlet.http.HttpServletRequest req)
Takes the host= parameter in the header to construct the real hostname. |
static java.lang.String |
getInputPath(javax.servlet.http.HttpServletRequest req)
Takes an input request and returns a proper relative path for the request. |
static java.lang.String |
getRootRelativeURL(javax.servlet.http.HttpServletRequest req,
java.lang.String rurl)
|
static java.io.InputStream |
httpGetStream(java.lang.String url,
int timeout)
Calls an external server and returns the response as an inputstream. |
static java.lang.String |
httpGetString(java.lang.String url,
int timeout)
Calls an external server and returns the response as a string. |
static org.w3c.dom.Document |
httpGetXMLDocument(java.lang.String url,
int timeout,
boolean namespaceaware)
Calls an external server and tries to retrieve an XML formatted document from it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void getHostURL(java.lang.StringBuffer sb, javax.servlet.http.HttpServletRequest req)
sb
- req
-
java.lang.Exception
public static java.lang.String getHostURL(javax.servlet.http.HttpServletRequest req)
public static java.lang.String getHostName(javax.servlet.http.HttpServletRequest req)
public static int getHostPort(javax.servlet.http.HttpServletRequest req)
public static java.lang.String getInputPath(javax.servlet.http.HttpServletRequest req)
req
-
public static java.lang.String getApplicationURL(javax.servlet.http.HttpServletRequest req)
req
-
public static java.lang.String getApplicationContext(javax.servlet.http.HttpServletRequest req)
req
-
public static void appendRootRelativeURL(java.lang.Appendable a, javax.servlet.http.HttpServletRequest req, java.lang.String rurl) throws java.io.IOException
a
-
java.io.IOException
- Nonsense exception needed by stupid Java checked exception crappublic static java.lang.String getRootRelativeURL(javax.servlet.http.HttpServletRequest req, java.lang.String rurl)
public static org.w3c.dom.Document httpGetXMLDocument(java.lang.String url, int timeout, boolean namespaceaware) throws java.lang.Exception
java.lang.Exception
public static java.io.InputStream httpGetStream(java.lang.String url, int timeout) throws java.lang.Exception
url
-
java.lang.Exception
public static java.lang.String httpGetString(java.lang.String url, int timeout) throws java.lang.Exception
url
-
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |