|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.batik.util.ParsedURLData
public class ParsedURLData
Holds the data for more URLs.
Field Summary | |
---|---|
protected static List |
acceptedEncodings
|
String |
contentEncoding
|
String |
contentType
|
protected String |
contentTypeCharset
The extracted charset parameter from the Content-Type header. |
protected String |
contentTypeMediaType
The extracted type/subtype from the Content-Type header. |
static byte[] |
GZIP_MAGIC
GZIP header magic number bytes, like found in a gzipped files, which are encoded in Intel format (i.e. little indian). |
boolean |
hasBeenOpened
|
String |
host
|
protected static String |
HTTP_ACCEPT_ENCODING_HEADER
|
protected static String |
HTTP_ACCEPT_HEADER
|
protected static String |
HTTP_ACCEPT_LANGUAGE_HEADER
|
protected static String |
HTTP_USER_AGENT_HEADER
|
String |
path
|
int |
port
|
protected URL |
postConnectionURL
The URL that was ultimately used to fetch the resource. |
String |
protocol
Since the Data instance is 'hidden' in the ParsedURL instance we make all our methods public. |
String |
ref
|
InputStream |
stream
|
Constructor Summary | |
---|---|
ParsedURLData()
Void constructor |
|
ParsedURLData(URL url)
Build from an existing URL. |
Method Summary | |
---|---|
protected URL |
buildURL()
Attempts to build a normal java.net.URL instance from this URL. |
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. |
boolean |
complete()
Returns true if the URL looks well formed and complete. |
boolean |
equals(Object obj)
Implement Object.equals for ParsedURLData. |
protected void |
extractContentTypeParts(String userAgent)
Extracts the type/subtype and charset parameter from the Content-Type header. |
String |
getContentEncoding(String userAgent)
Returns the content encoding if available. |
String |
getContentType(String userAgent)
Returns the content type if available. |
String |
getContentTypeCharset(String userAgent)
Returns the content type's charset parameter, if available. |
String |
getContentTypeMediaType(String userAgent)
Returns the content type's type/subtype, if available. |
String |
getPortStr()
Returns the URL up to and include the port number on the host. |
String |
getPostConnectionURL()
Returns the URL that was ultimately used to fetch the resource represented by the ParsedURL . |
boolean |
hasContentTypeParameter(String userAgent,
String param)
Returns whether the Content-Type header has the given parameter. |
int |
hashCode()
Implement Object.hashCode. |
InputStream |
openStream(String userAgent,
Iterator mimeTypes)
Open the stream and check for common compression types. |
protected InputStream |
openStreamInternal(String userAgent,
Iterator mimeTypes,
Iterator encodingTypes)
|
InputStream |
openStreamRaw(String userAgent,
Iterator mimeTypes)
Open the stream and returns it. |
protected boolean |
sameFile(ParsedURLData other)
|
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 final String HTTP_USER_AGENT_HEADER
protected static final String HTTP_ACCEPT_HEADER
protected static final String HTTP_ACCEPT_LANGUAGE_HEADER
protected static final String HTTP_ACCEPT_ENCODING_HEADER
protected static List acceptedEncodings
public static final byte[] GZIP_MAGIC
public String protocol
public String host
public int port
public String path
public String ref
public String contentType
public String contentEncoding
public InputStream stream
public boolean hasBeenOpened
protected String contentTypeMediaType
protected String contentTypeCharset
protected URL postConnectionURL
Constructor Detail |
---|
public ParsedURLData()
public ParsedURLData(URL url)
Method Detail |
---|
public static InputStream checkGZIP(InputStream is) throws IOException
is
- Stream that may potentially be a GZIP stream.
IOException
protected URL buildURL() throws MalformedURLException
MalformedURLException
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String getContentType(String userAgent)
public String getContentTypeMediaType(String userAgent)
public String getContentTypeCharset(String userAgent)
public boolean hasContentTypeParameter(String userAgent, String param)
protected void extractContentTypeParts(String userAgent)
public String getContentEncoding(String userAgent)
public boolean complete()
public InputStream openStream(String userAgent, Iterator mimeTypes) throws 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)
IOException
public InputStream openStreamRaw(String userAgent, Iterator mimeTypes) throws 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)
IOException
protected InputStream openStreamInternal(String userAgent, Iterator mimeTypes, Iterator encodingTypes) throws IOException
IOException
public String getPortStr()
protected boolean sameFile(ParsedURLData other)
public String toString()
toString
in class Object
public String getPostConnectionURL()
ParsedURL
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |