|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jaxfront.core.util.URLHelper
public class URLHelper
Field Summary | |
---|---|
static java.net.URL |
_xuiXsdURL
|
static java.lang.String |
CONFIG_DIRECTORY
|
static java.lang.String |
EXAMPLES_DIRECTORY
|
static java.lang.String |
URL_SEPARATOR
|
Constructor Summary | |
---|---|
URLHelper()
|
Method Summary | |
---|---|
boolean |
checkURL(java.lang.String url)
|
boolean |
checkURL(java.net.URL url)
|
static java.lang.String |
createFileNameWithSuffix(java.lang.String fileName,
java.lang.String suffix,
java.lang.String extension)
|
static java.lang.String |
createFileNameWithSuffix(java.net.URL xuiUrl,
java.lang.String suffix,
java.lang.String extension)
Creates the nls file name from a passing XUI URL and a language. |
static java.lang.String |
createFileNameWithSuffix(java.net.URL xuiURL,
java.lang.String fileName,
java.lang.String suffix,
java.lang.String extension)
Creates the nls file name from a passing file name (string) and a language. |
static java.lang.String |
createNLSFileName(java.net.URL xuiUrl,
java.lang.String language)
Creates the nls file name from a passing XUI URL and a language. |
static java.lang.String |
createNLSFilePathLocation(java.net.URL xuiUrl,
java.lang.String language)
Creates the nls file path location from a passing XUI URL and a language. |
static java.net.URL |
createNLSURL(java.net.URL xuiUrl,
java.lang.String language)
Creates a nls URL from a passing xui URL and a language. |
static java.lang.String |
createNLSURLName(java.net.URL xuiUrl,
java.lang.String language)
Creates the nls file location from a passing XUI URL and a language. |
static boolean |
doesUrlExist(java.net.URL url)
|
static java.net.HttpURLConnection |
doSend(java.lang.String aUrl2S,
java.lang.String sessionId,
byte[] content,
java.lang.String encoding,
boolean contentAsParameter)
|
static java.lang.String |
extractFileName(java.lang.String path)
|
static java.lang.String |
extractSessionId(java.lang.String response)
|
static java.net.URL |
getActionsURL()
|
static java.net.URL |
getDefaultLocationURL(java.net.URL baseUrl,
java.lang.String extension)
|
static java.net.URL |
getDefaultXMLLocationURL(java.net.URL baseUrl)
|
static java.net.URL |
getDefaultXSDLocationURL(java.net.URL baseUrl)
|
static java.net.URL |
getDefaultXUILocationURL(java.net.URL baseUrl)
|
static java.io.File |
getFile(java.net.URL url)
|
static java.lang.String |
getFileName(java.net.URL url)
|
static java.net.URL |
getFunctionsURL()
|
static java.net.URL |
getFunctionsXSDURL()
|
static java.net.URL |
getHelpTemplateURL()
|
static java.lang.String |
getHostAddress(java.lang.String url)
Returns the host address of an url string. |
static int |
getHostPort(java.lang.String url)
Returns the host port of an url string. |
static java.net.URL |
getInternalURL(java.lang.String url)
Try to resolve an url within the classpath. |
static java.net.URL |
getJAXFormsURL(java.net.URL xsdURL,
java.net.URL xuiURL)
|
static java.net.URL |
getParentURL(java.net.URL aUrl)
|
static java.net.URL |
getPluginsURL()
|
static java.net.URL |
getPluginsXSDURL()
|
static java.net.URL |
getPreferencesXSDURL()
|
static java.lang.String |
getRelativePath(java.io.File home,
java.io.File f)
get relative path of File 'f' with respect to 'home' directory example : home = /a/b/c f = /a/d/e/x.txt s = getRelativePath(home,f) = ../.. |
static java.lang.String |
getRelativePath(java.net.URL base,
java.net.URL rel)
|
static java.net.URI |
getUri(java.lang.String path)
|
static java.net.URI |
getUri(java.net.URL url)
|
static java.net.URL |
getUrlFromUri(java.net.URI uri)
|
static java.net.URL |
getUserHomeURL(java.lang.String relativeURL)
|
static java.net.URL |
getUserURL(java.lang.String url)
|
static java.net.URL |
getUserURL(java.lang.String url,
boolean lookupInternal)
|
static java.net.URL |
getUserURL(java.net.URL targetURL,
java.lang.String url)
|
static java.net.URL |
getUserURL(java.net.URL targetURL,
java.lang.String url,
boolean lookupInternal)
|
static java.net.URL |
getXMLDBMappingURL(java.net.URL xsdURL,
java.net.URL xuiURL)
|
static java.net.URL |
getXUIXsdURL()
|
static boolean |
isDefinedLanguage(java.lang.String language)
|
static boolean |
isUrl(java.lang.String url)
|
static java.io.InputStream |
openStream(java.net.URL from)
Opens a connection to this URL and returns an
InputStream for reading from that connection. |
static boolean |
pointToSameFolder(java.net.URL url1,
java.net.URL url2)
|
static java.lang.StringBuffer |
readResponse(java.net.HttpURLConnection con)
|
static java.net.URI |
relativize(java.net.URL base,
java.net.URI rel)
|
static java.net.URI |
relativize(java.net.URL base,
java.net.URL rel)
|
static java.net.URI |
resolve(java.net.URL base,
java.lang.String rel)
|
static boolean |
urlResourceExist(java.net.URL resURL)
|
static void |
writeResponse(java.net.HttpURLConnection con,
java.lang.String content)
|
static void |
writeToUrl(java.net.URL storeToUrl,
char[] buffer)
|
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_SEPARATOR
public static final java.lang.String CONFIG_DIRECTORY
public static final java.lang.String EXAMPLES_DIRECTORY
public static java.net.URL _xuiXsdURL
Constructor Detail |
---|
public URLHelper()
Method Detail |
---|
public static java.net.URL getXUIXsdURL()
public static java.net.URI getUri(java.lang.String path) throws java.net.URISyntaxException
java.net.URISyntaxException
public static java.net.URI getUri(java.net.URL url) throws java.net.URISyntaxException
java.net.URISyntaxException
public static java.lang.StringBuffer readResponse(java.net.HttpURLConnection con) throws java.io.IOException
java.io.IOException
public static void writeResponse(java.net.HttpURLConnection con, java.lang.String content) throws java.io.IOException
java.io.IOException
public static java.net.HttpURLConnection doSend(java.lang.String aUrl2S, java.lang.String sessionId, byte[] content, java.lang.String encoding, boolean contentAsParameter) throws java.net.MalformedURLException, java.io.IOException, java.net.ProtocolException
java.net.MalformedURLException
java.io.IOException
java.net.ProtocolException
public static java.lang.String extractSessionId(java.lang.String response)
public static java.io.InputStream openStream(java.net.URL from) throws java.io.IOException
URL
and returns an
InputStream
for reading from that connection. This method
is a shorthand for: openConnection().getInputStream()
java.io.IOException
- if an I/O exception occurs.URL.openConnection()
,
URLConnection.getInputStream()
public static java.net.URL getUrlFromUri(java.net.URI uri) throws java.net.MalformedURLException
java.net.MalformedURLException
public static java.net.URL getUserURL(java.net.URL targetURL, java.lang.String url, boolean lookupInternal)
public static java.net.URL getUserURL(java.net.URL targetURL, java.lang.String url)
public static java.net.URL getUserURL(java.lang.String url)
public static java.net.URL getUserURL(java.lang.String url, boolean lookupInternal)
public static java.net.URL getPluginsURL()
public static java.net.URL getActionsURL()
public static java.net.URL getHelpTemplateURL()
public static java.net.URL getFunctionsURL()
public static java.net.URL getFunctionsXSDURL()
public static java.net.URL getPluginsXSDURL()
public static java.net.URL getPreferencesXSDURL()
public static java.net.URL getUserHomeURL(java.lang.String relativeURL)
public static java.net.URL getInternalURL(java.lang.String url)
url
- public static int getHostPort(java.lang.String url)
url
- url string.public static void writeToUrl(java.net.URL storeToUrl, char[] buffer) throws java.io.IOException
java.io.IOException
public static java.lang.String getHostAddress(java.lang.String url)
url
- url string.public static java.io.File getFile(java.net.URL url)
public static java.net.URL createNLSURL(java.net.URL xuiUrl, java.lang.String language)
xuiUrl
- language
-
public static boolean isDefinedLanguage(java.lang.String language)
public static java.lang.String createNLSFilePathLocation(java.net.URL xuiUrl, java.lang.String language)
xuiUrl
- language
- public static java.lang.String createNLSFileName(java.net.URL xuiUrl, java.lang.String language)
xuiUrl
- language
- public static java.lang.String createFileNameWithSuffix(java.net.URL xuiUrl, java.lang.String suffix, java.lang.String extension)
xuiUrl
- language
- public static java.lang.String createFileNameWithSuffix(java.lang.String fileName, java.lang.String suffix, java.lang.String extension)
public static java.lang.String createFileNameWithSuffix(java.net.URL xuiURL, java.lang.String fileName, java.lang.String suffix, java.lang.String extension)
fileName
- name of the filesuffix
- file suffixextension
- file extensionpublic static java.lang.String createNLSURLName(java.net.URL xuiUrl, java.lang.String language)
xuiUrl
- language
- public static java.lang.String extractFileName(java.lang.String path)
public static java.net.URL getParentURL(java.net.URL aUrl)
public static java.net.URL getDefaultXUILocationURL(java.net.URL baseUrl)
public static java.net.URL getDefaultXSDLocationURL(java.net.URL baseUrl)
public static java.net.URL getDefaultXMLLocationURL(java.net.URL baseUrl)
public static java.net.URL getDefaultLocationURL(java.net.URL baseUrl, java.lang.String extension)
public static boolean doesUrlExist(java.net.URL url)
public static boolean pointToSameFolder(java.net.URL url1, java.net.URL url2)
public static java.net.URI relativize(java.net.URL base, java.net.URL rel)
public static java.net.URI relativize(java.net.URL base, java.net.URI rel)
public static java.net.URI resolve(java.net.URL base, java.lang.String rel)
public static java.lang.String getRelativePath(java.net.URL base, java.net.URL rel)
public static java.lang.String getRelativePath(java.io.File home, java.io.File f)
home
- base path, should be a directory, not a file, or it doesn't
make sensef
- file to generate path for
public static java.lang.String getFileName(java.net.URL url)
public static boolean isUrl(java.lang.String url)
public boolean checkURL(java.lang.String url)
public boolean checkURL(java.net.URL url)
public static java.net.URL getXMLDBMappingURL(java.net.URL xsdURL, java.net.URL xuiURL)
public static java.net.URL getJAXFormsURL(java.net.URL xsdURL, java.net.URL xuiURL)
public static boolean urlResourceExist(java.net.URL resURL)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |