public class URLUtil extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROTOCOL_FILE |
static java.lang.String |
PROTOCOL_FTP |
static java.lang.String |
PROTOCOL_GOPHER |
static java.lang.String |
PROTOCOL_HTTP |
static java.lang.String |
PROTOCOL_JAR |
Constructor and Description |
---|
URLUtil() |
Modifier and Type | Method and Description |
---|---|
static java.net.URL |
buildURL(java.lang.String basePath,
java.lang.String url)
Build a URL from a base path and specified url.
|
static java.lang.String |
getNetworkURLString(java.lang.String base,
java.lang.String path) |
static java.net.URL |
getURL(java.lang.String path)
Convert a network path to a URL
|
static java.lang.String |
getURLDirectory(java.lang.String url) |
static java.lang.String |
getURLDirectory(java.net.URL url) |
static java.lang.String |
getURLFileExtension(java.lang.String url,
boolean withDot) |
static java.lang.String |
getURLFileExtension(java.net.URL url,
boolean withDot) |
static java.lang.String |
getURLFileName(java.lang.String url) |
static java.lang.String |
getURLFileName(java.lang.String url,
boolean withExtension) |
static java.lang.String |
getURLFileName(java.net.URL url) |
static java.lang.String |
getURLFileName(java.net.URL url,
boolean withExtension) |
static java.lang.String |
getURLHost(java.net.URL url) |
static java.lang.String |
getURLProtocol(java.net.URL url) |
static java.lang.String |
getURLQuery(java.net.URL url) |
static boolean |
isAbsolute(java.lang.String path)
Returns
true if the url defines an absolute address and false if it
defines a relative address. |
static boolean |
isFileURL(java.lang.String path) |
static boolean |
isFileURL(java.net.URL url) |
static boolean |
isNetworkURL(java.lang.String path) |
static boolean |
isNetworkURL(java.net.URL url) |
static boolean |
isURL(java.lang.String path) |
public static final java.lang.String PROTOCOL_FILE
public static final java.lang.String PROTOCOL_FTP
public static final java.lang.String PROTOCOL_GOPHER
public static final java.lang.String PROTOCOL_HTTP
public static final java.lang.String PROTOCOL_JAR
public URLUtil()
public static java.net.URL getURL(java.lang.String path)
public static boolean isURL(java.lang.String path)
public static boolean isNetworkURL(java.lang.String path)
public static boolean isNetworkURL(java.net.URL url)
public static boolean isFileURL(java.lang.String path)
public static boolean isFileURL(java.net.URL url)
public static boolean isAbsolute(java.lang.String path)
true
if the url defines an absolute address and false
if it
defines a relative address.public static java.lang.String getNetworkURLString(java.lang.String base, java.lang.String path)
public static java.lang.String getURLProtocol(java.net.URL url)
public static java.lang.String getURLHost(java.net.URL url)
public static java.lang.String getURLDirectory(java.lang.String url)
public static java.lang.String getURLDirectory(java.net.URL url)
public static java.lang.String getURLFileName(java.lang.String url)
public static java.lang.String getURLFileName(java.lang.String url, boolean withExtension)
public static java.lang.String getURLFileName(java.net.URL url)
public static java.lang.String getURLFileName(java.net.URL url, boolean withExtension)
public static java.lang.String getURLFileExtension(java.lang.String url, boolean withDot)
public static java.lang.String getURLFileExtension(java.net.URL url, boolean withDot)
public static java.lang.String getURLQuery(java.net.URL url)
public static java.net.URL buildURL(java.lang.String basePath, java.lang.String url)