|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.lanl.archive.rewrite.UrlOperations
public class UrlOperations
Class containing common static URL methods. Primarily resolveUrl() and the (currently) unused isAuthority().
Field Summary | |
---|---|
static String[] |
ALL_SCHEMES
array of static Strings for all "known" schemes |
static String |
DEFAULT_SCHEME
Default scheme to assume if unspecified. |
static String |
DNS_SCHEME
ARC/WARC specific DNS resolution record. |
static String |
FTP_SCHEME
FTP |
static String |
HTTP_SCHEME
HTTP |
static String |
HTTPS_SCHEME
HTTPS |
static String |
MMS_SCHEME
MMS |
static char |
PATH_START
character which delimits the path from the authority in a... |
static char |
PORT_SEPARATOR
character separating host from port within a URL authority |
static String |
RTSP_SCHEME
RTSP |
static String |
WAIS_SCHEME
go brewster |
Constructor Summary | |
---|---|
UrlOperations()
|
Method Summary | |
---|---|
static String |
fixupHTTPUrlWithOneSlash(String orig)
|
static String |
getUrlParentDir(String url)
Find and return the parent directory of the URL argument |
static String |
getURLPath(String url)
Attempt to extract the path component of a url String argument. |
static boolean |
isAuthority(String authString)
Tests if the String argument looks like it could be a legitimate authority fragment of a URL, that is, is it an IP address, or, are the characters legal in an authority, and does the string end with a legal TLD. |
static String |
resolveUrl(String baseUrl,
String url)
Resolve a possibly relative url argument against a base URL. |
static int |
schemeToDefaultPort(String scheme)
Return the default port for the scheme String argument, if known. |
static String |
stripDefaultPortFromUrl(String url)
Attempt to strip default ports out of URL strings. |
static String |
stripURLScheme(String url)
Attempt to extract the path component of a url String argument. |
static String |
urlToHost(String url)
Attempt to extract the hostname component of an absolute URL argument. |
static String |
urlToScheme(String url)
Attempt to find the scheme (http://, https://, etc) from a given URL. |
static String |
urlToUserInfo(String url)
Extract userinfo from the absolute URL argument, that is, "username@", or "username:password@" if present. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DNS_SCHEME
public static final String HTTP_SCHEME
public static final String HTTPS_SCHEME
public static final String FTP_SCHEME
public static final String MMS_SCHEME
public static final String RTSP_SCHEME
public static final String DEFAULT_SCHEME
public static final String WAIS_SCHEME
public static final String[] ALL_SCHEMES
public static final char PORT_SEPARATOR
public static final char PATH_START
Constructor Detail |
---|
public UrlOperations()
Method Detail |
---|
public static boolean isAuthority(String authString)
authString
- String representation of a fragment of a URL
public static String resolveUrl(String baseUrl, String url)
baseUrl
- the base URL against which the url should be resolvedurl
- the URL, possibly relative, to make absolute.
public static String urlToScheme(String url)
url
- URL String to parse for a scheme.
public static int schemeToDefaultPort(String scheme)
scheme
- String scheme, including '://', as in, "http://", "ftp://"
public static String getURLPath(String url)
url
- the URL which may contain a path, sans scheme.
public static String stripURLScheme(String url)
url
- the URL which may contain a path, sans scheme.
public static String stripDefaultPortFromUrl(String url)
url
- the original URL possibly including a port
public static String fixupHTTPUrlWithOneSlash(String orig)
orig
- String containing a URL, possibly beginning with "http:/".
public static String urlToHost(String url)
url
- the url String from which to extract the hostname
public static String urlToUserInfo(String url)
url
- the URL from which to extract the userinfo
public static String getUrlParentDir(String url)
url
- to find the parent directory of
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |