|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ideo.sweetdevria.util.URLUtils
public class URLUtils
| Constructor Summary | |
|---|---|
URLUtils()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
addParamToUrl(java.lang.String url,
java.lang.String paramName,
java.lang.Object paramValue)
Add a GET parameter to the url. |
static java.lang.String |
addParamToUrl(java.lang.String url,
java.lang.String paramName,
java.lang.String paramValue)
|
static java.lang.String |
concatUrlWithSlaches(java.lang.String firstPart,
java.lang.String secondPart)
Concat two part of an url into one. |
static java.lang.String |
encodeParams(java.lang.String params)
prepare params and transform them into URL GET params |
static java.net.URL |
formatAjaxUrl(javax.servlet.http.HttpServletRequest request,
java.lang.String url,
java.lang.String pageId)
Builds an URL object from the url sent |
static java.net.URL |
formatAjaxUrlForServer(javax.servlet.http.HttpServletRequest request,
java.lang.String url,
java.lang.String pageId)
FIX : Portlet compatibility. |
static java.net.URL |
formatUrl(java.lang.String url,
javax.servlet.http.HttpServletRequest request,
java.lang.String pageId)
Build an url corresponding to the string. |
static java.net.URL |
formatUrlForServer(java.lang.String url,
javax.servlet.http.HttpServletRequest request,
java.lang.String pageId)
FIX : Portlet compatibility. |
static java.io.InputStream |
getFileContent(java.net.URL url,
java.lang.String sessionId)
Open an input stream to the specified URL. |
static java.lang.String |
getFileFromUrl(java.lang.String url)
|
static java.lang.String |
getPathFromUrl(java.net.URL url,
javax.servlet.http.HttpServletRequest request)
SWTRIA-971 Extract from an url the path relative to the context of the reference request. |
static java.lang.String |
getServerContext(javax.servlet.http.HttpServletRequest request)
return Server port |
static java.lang.String |
getServerName(javax.servlet.http.HttpServletRequest request)
return Server Name |
static java.lang.String |
getServerPort(javax.servlet.http.HttpServletRequest request)
return Server port |
static java.lang.String |
getServerScheme(javax.servlet.http.HttpServletRequest request)
return Server Scheme |
static java.lang.String |
getURLContent(java.net.URL url,
javax.servlet.http.HttpServletRequest request,
java.lang.String inputs)
Return the content of an url |
static boolean |
isAdressLocal(java.net.URL url,
javax.servlet.http.HttpServletRequest request)
SWTRIA-971 Test if the url is local in the conext of the referent request. |
static void |
propagateCookies(javax.servlet.http.HttpServletRequest request,
java.net.URLConnection connection)
Propagate the whole informations transmitted into the request cookie |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public URLUtils()
| Method Detail |
|---|
public static java.io.InputStream getFileContent(java.net.URL url,
java.lang.String sessionId)
throws java.io.IOException
url - URL link to the filesessionId - Session ID to specify in the URL (could be null).
java.io.IOException
public static java.lang.String getURLContent(java.net.URL url,
javax.servlet.http.HttpServletRequest request,
java.lang.String inputs)
throws java.io.IOException
url - the url to callrequest - the original request processing the url demand
java.io.IOException
public static java.net.URL formatAjaxUrl(javax.servlet.http.HttpServletRequest request,
java.lang.String url,
java.lang.String pageId)
throws java.net.MalformedURLException
request - url - the url to formatpageId - used to propagate the current page configuration, and use the statefull zones
java.net.MalformedURLException
public static java.net.URL formatAjaxUrlForServer(javax.servlet.http.HttpServletRequest request,
java.lang.String url,
java.lang.String pageId)
throws java.net.MalformedURLException
request - url - the url to formatpageId - used to propagate the current page configuration, and use the statefull zones
java.net.MalformedURLException
public static java.net.URL formatUrl(java.lang.String url,
javax.servlet.http.HttpServletRequest request,
java.lang.String pageId)
throws java.net.MalformedURLException
url - the url to buildpageId - used to propagate the current page configuration, and use the statefull zones
java.net.MalformedURLException
public static java.net.URL formatUrlForServer(java.lang.String url,
javax.servlet.http.HttpServletRequest request,
java.lang.String pageId)
throws java.net.MalformedURLException
url - the url to buildpageId - used to propagate the current page configuration, and use the statefull zones
java.net.MalformedURLExceptionpublic static java.lang.String getServerScheme(javax.servlet.http.HttpServletRequest request)
request -
public static java.lang.String getServerName(javax.servlet.http.HttpServletRequest request)
request -
public static java.lang.String getServerPort(javax.servlet.http.HttpServletRequest request)
request -
public static java.lang.String getServerContext(javax.servlet.http.HttpServletRequest request)
request -
public static void propagateCookies(javax.servlet.http.HttpServletRequest request,
java.net.URLConnection connection)
request - the request given in parameter.connection - the connection that will propagate the cookies
{@link - IllegalStateException}
public static boolean isAdressLocal(java.net.URL url,
javax.servlet.http.HttpServletRequest request)
throws java.net.MalformedURLException
url - the Url from which the path will be extractedrequest - Reference request
java.net.MalformedURLException
public static java.lang.String getPathFromUrl(java.net.URL url,
javax.servlet.http.HttpServletRequest request)
throws java.net.MalformedURLException
url - the Url from which the path will be extractedrequest - Reference request
java.net.MalformedURLExceptionpublic static java.lang.String getFileFromUrl(java.lang.String url)
url -
public static java.lang.String encodeParams(java.lang.String params)
params -
public static java.lang.String concatUrlWithSlaches(java.lang.String firstPart,
java.lang.String secondPart)
firstPart - secondPart -
public static java.lang.String addParamToUrl(java.lang.String url,
java.lang.String paramName,
java.lang.Object paramValue)
url - paramName - Name of the parameter. Could not be null.paramValue -
public static java.lang.String addParamToUrl(java.lang.String url,
java.lang.String paramName,
java.lang.String paramValue)
propertyName -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||