|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.util.ParsedURLData
Holds the data for more URL's
Field Summary | |
protected static java.util.List |
acceptedEncodings
|
java.lang.String |
contentEncoding
|
java.lang.String |
contentType
|
static byte[] |
GZIP_MAGIC
GZIP header magic number bytes, like found in a gzipped files, which are encoded in Intel format (ie. |
boolean |
hasBeenOpened
|
java.lang.String |
host
|
java.lang.String |
path
|
int |
port
|
java.lang.String |
protocol
Since the Data instance is 'hidden' in the ParsedURL instance we make all our methods public. |
java.lang.String |
ref
|
java.io.InputStream |
stream
|
Constructor Summary | |
ParsedURLData()
Void constructor |
|
ParsedURLData(java.net.URL url)
Build from an existing URL. |
Method Summary | |
protected java.net.URL |
buildURL()
Attempts to build a normal java.net.URL instance from this URL. |
static java.io.InputStream |
checkGZIP(java.io.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. |
boolean |
complete()
Returns true if the URL looks well formed and complete. |
boolean |
equals(java.lang.Object obj)
Implement Object.equals for ParsedURLData. |
java.lang.String |
getContentEncoding(java.lang.String userAgent)
Returns the content encoding if available. |
java.lang.String |
getContentType(java.lang.String userAgent)
Returns the content type if available. |
java.lang.String |
getPortStr()
Returns the URL up to and include the port number on the host. |
int |
hashCode()
Implement Object.hashCode. |
java.io.InputStream |
openStream(java.lang.String userAgent,
java.util.Iterator mimeTypes)
Open the stream and check for common compression types. |
protected java.io.InputStream |
openStreamInternal(java.lang.String userAgent,
java.util.Iterator mimeTypes,
java.util.Iterator encodingTypes)
|
java.io.InputStream |
openStreamRaw(java.lang.String userAgent,
java.util.Iterator mimeTypes)
Open the stream and returns it. |
protected boolean |
sameFile(ParsedURLData other)
|
java.lang.String |
toString()
Return a string representation of the data. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static java.util.List acceptedEncodings
public static final byte[] GZIP_MAGIC
public java.lang.String protocol
public java.lang.String host
public int port
public java.lang.String path
public java.lang.String ref
public java.lang.String contentType
public java.lang.String contentEncoding
public java.io.InputStream stream
public boolean hasBeenOpened
Constructor Detail |
public ParsedURLData()
public ParsedURLData(java.net.URL url)
Method Detail |
public static java.io.InputStream checkGZIP(java.io.InputStream is) throws java.io.IOException
is
- Stream that may potentially be a GZIP stream.protected java.net.URL buildURL() throws java.net.MalformedURLException
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String getContentType(java.lang.String userAgent)
public java.lang.String getContentEncoding(java.lang.String userAgent)
public boolean complete()
public java.io.InputStream openStream(java.lang.String userAgent, java.util.Iterator mimeTypes) throws java.io.IOException
userAgent
- The user agent opening the stream (may be null).mimeTypes
- The expected mime types of the content
in the returned InputStream (mapped to Http accept
header among other possability). The elements of
the iterator must be strings (may be null)public java.io.InputStream openStreamRaw(java.lang.String userAgent, java.util.Iterator mimeTypes) throws java.io.IOException
userAgent
- The user agent opening the stream (may be null).mimeTypes
- The expected mime types of the content
in the returned InputStream (mapped to Http accept
header among other possability). The elements of
the iterator must be strings (may be null)protected java.io.InputStream openStreamInternal(java.lang.String userAgent, java.util.Iterator mimeTypes, java.util.Iterator encodingTypes) throws java.io.IOException
public java.lang.String getPortStr()
protected boolean sameFile(ParsedURLData other)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |