|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.core.URLUtil
public final class URLUtil
URL Utilities. These are helper functions for dealing with urls.
Method Summary | |
---|---|
static java.net.URL |
asURL(java.net.URL context,
java.lang.String spec)
Evaluates a string of a possibly relative url in the context of a different url. |
static java.net.URL |
concatURL(java.lang.String path,
java.lang.String file)
Create a URL from a path and file name. |
static java.io.File |
file(java.net.URL urlContext,
boolean warning)
Generate a File for a URL. |
static java.net.URL |
formURL(java.lang.String url,
java.lang.String context)
Create a URL to a web server. |
static java.lang.String |
formURLString(java.lang.String url,
java.lang.String context)
Create a URL string to a web server. |
static boolean |
fullyQualifiedURLSpec(java.lang.String spec)
Returns whether the specified specification is a fully-qualified URL. |
static java.net.URL |
makeURL(java.lang.String spec)
Wrapper class to create a new URL object. |
static java.net.URL |
makeURL(java.lang.String protocol,
java.lang.String host,
int port,
java.lang.String file)
Wrapper class to create a new URL object. |
static boolean |
maybeURLExists(java.net.URL url)
Returns true if the URL may exist. |
static java.net.URL |
url()
Creates a URL for the application working directory. |
static java.net.URL |
url(java.io.File file)
Creates a URL relative to the application working directory. |
static java.net.URL |
url(java.lang.String spec)
Creates a URL relative to the application working directory. |
static java.net.URL |
urlAbsolute(java.io.File file)
Creates a URL that references the given file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.io.File file(java.net.URL urlContext, boolean warning)
urlContext
- a URL to open in a file. Assumes URL is of
type file protocol (e.g. file://) and is not null.warning
- if true, on error, a warning will be printed
public static boolean maybeURLExists(java.net.URL url)
url
- the input URL
public static java.net.URL asURL(java.net.URL context, java.lang.String spec)
context
- the context in which to parse the
specification.spec
- a string representation of a URL.
URL.URL(URL, String)
public static java.net.URL url(java.io.File file)
file
- the file object used to create the url, cannot be null.
public static java.net.URL url(java.lang.String spec)
spec
- the String that specifies the resource (typically a file). This String
must be a relative path (relative to the application working directory).
public static java.net.URL url()
public static java.net.URL urlAbsolute(java.io.File file)
public static boolean fullyQualifiedURLSpec(java.lang.String spec)
public static java.net.URL formURL(java.lang.String url, java.lang.String context) throws java.net.MalformedURLException
context
.
url
- the URL string we are making a URL object forcontext
- the root URL
java.net.MalformedURLException
public static java.net.URL concatURL(java.lang.String path, java.lang.String file)
path
- the path (either absolute or relative)file
- the file name.
public static java.net.URL makeURL(java.lang.String spec) throws java.net.MalformedURLException
spec
- the URL spec, cannot be null.
java.net.MalformedURLException
- if the spec is illegal.public static java.net.URL makeURL(java.lang.String protocol, java.lang.String host, int port, java.lang.String file) throws java.net.MalformedURLException
protocol
- the name of the protocol to use.host
- the name of the host.port
- the port number on the host.file
- the file on the host
java.net.MalformedURLException
- if the spec is illegal.public static java.lang.String formURLString(java.lang.String url, java.lang.String context)
context
, e.g.
"http://hostname/AribaORMS".
url
- url string we are making a URL object forcontext
- the root url
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |