|
|||||||||
| 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 URL |
asURL(URL context,
String spec)
Evaluates a string of a possibly relative url in the context of a different url. |
static URL |
concatURL(String path,
String file)
Create a URL from a path and file name. |
static File |
file(URL urlContext,
boolean warning)
Generate a File for a URL. |
static URL |
formURL(String url,
String context)
Create a URL to a web server. |
static String |
formURLString(String url,
String context)
Create a URL string to a web server. |
static boolean |
fullyQualifiedURLSpec(String spec)
Returns whether the specified specification is a fully-qualified URL. |
static URL |
makeURL(String spec)
Wrapper class to create a new URL object. |
static URL |
makeURL(String protocol,
String host,
int port,
String file)
Wrapper class to create a new URL object. |
static boolean |
maybeURLExists(URL url)
Returns true if the URL may exist. |
static URL |
url()
Creates a URL for the application working directory. |
static URL |
url(File file)
Creates a URL relative to the application working directory. |
static URL |
url(String spec)
Creates a URL relative to the application working directory. |
static URL |
urlAbsolute(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 File file(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(URL url)
url - the input URL
public static URL asURL(URL context,
String spec)
context - the context in which to parse the
specification.spec - a string representation of a URL.
URL.URL(URL, String)public static URL url(File file)
file - the file object used to create the url, cannot be null.
public static URL url(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 URL url()
public static URL urlAbsolute(File file)
public static boolean fullyQualifiedURLSpec(String spec)
public static URL formURL(String url,
String context)
throws MalformedURLException
context.
url - the URL string we are making a URL object forcontext - the root URL
MalformedURLException
public static URL concatURL(String path,
String file)
path - the path (either absolute or relative)file - the file name.
public static URL makeURL(String spec)
throws MalformedURLException
spec - the URL spec, cannot be null.
MalformedURLException - if the spec is illegal.
public static URL makeURL(String protocol,
String host,
int port,
String file)
throws 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
MalformedURLException - if the spec is illegal.
public static String formURLString(String url,
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 | ||||||||