Method Summary |
|
public static InputStream | checkGZIP(InputStream is) This is a utility function others can call that checks if
is is a GZIP stream if so it returns a GZIPInputStream that
will decode the contents, otherwise it returns (or a
buffered version of is) untouched. |
public boolean | complete() Returns true if the URL looks well formed and complete. |
public boolean | equals(Object obj) Implement Object.equals. |
public String | getContentEncoding() Returns the content encoding if available. |
public String | getContentType() Returns the content type if available. |
public static String | getGlobalUserAgent() |
public static synchronized ParsedURLProtocolHandler | getHandler(String protocol) Returns the handler for a particular protocol. |
public String | getHost() Returns the host for this URL, if any, null if there isn't
one or it doesn't make sense for the protocol. |
public String | getPath() Returns the path for this URL, if any (where appropriate for
the protocol this also includes the file, not just directory). |
public int | getPort() Returns the port on the host to connect to, if it was specified
in the url that was parsed, otherwise returns -1. |
public String | getPortStr() Returns the URL up to and include the port number on
the host. |
public String | getProtocol() Returns the protocol for this URL. |
protected static String | getProtocol(String urlStr) Parse out the protocol from a url string. |
public String | getRef() Returns the 'fragment' reference in the URL. |
public String | getUserAgent() Return the user agent current associated with this url (or
null if none). |
public int | hashCode() Implement Object.hashCode. |
public InputStream | openStream() Attempt to open the stream checking for common compression
types, and automatically decompressing them if found. |
public InputStream | openStream(String mimeType) Attempt to open the stream checking for common compression
types, and automatically decompressing them if found. |
public InputStream | openStream(String[] mimeTypes) Attempt to open the stream checking for common compression
types, and automatically decompressing them if found. |
public InputStream | openStream(Iterator mimeTypes) Attempt to open the stream checking for common compression
types, and automatically decompressing them if found.
Parameters: mimeTypes - The expected mime types of the content in the returned InputStream (mapped to Http acceptheader among other possabilities). |
public InputStream | openStreamRaw() Attempt to open the stream, does no checking for compression
types. |
public InputStream | openStreamRaw(String mimeType) Attempt to open the stream, does no checking for compression
types. |
public InputStream | openStreamRaw(String[] mimeTypes) Attempt to open the stream, does no checking for comression
types. |
public InputStream | openStreamRaw(Iterator mimeTypes) Attempt to open the stream, does no checking for comression
types.
Parameters: mimeTypes - The expected mime types of the content in the returned InputStream (mapped to Http acceptheader among other possabilities). |
public static ParsedURLData | parseURL(String urlStr) |
public static ParsedURLData | parseURL(String baseStr, String urlStr) Factory method to construct an appropriate subclass of ParsedURLData,
for a sub url. |
public static ParsedURLData | parseURL(ParsedURL baseURL, String urlStr) Factory method to construct an appropriate subclass of ParsedURLData,
for a sub url. |
public static synchronized void | registerHandler(ParsedURLProtocolHandler handler) Registers a Protocol handler by adding it to the handlers map. |
public boolean | sameFile(ParsedURL other) |
public static void | setGlobalUserAgent(String userAgent) |
public void | setUserAgent(String userAgent) Sets the user agent associated with this url (null clears
any associated user agent). |
public String | toString() Return a string rep of the URL (can be passed back into the
constructor if desired). |