Modifier | Constructor and Description |
---|---|
protected |
DataUrlDecoder(byte[] data,
String mediaType,
String charset)
C'tor.
|
Modifier and Type | Method and Description |
---|---|
static DataUrlDecoder |
decode(URL url)
Decodes a data URL providing simple access to the information contained by the URL.
|
static DataUrlDecoder |
decodeDataURL(String url)
Decodes a data URL providing simple access to the information contained by the URL.
|
byte[] |
getBytes()
Gets the bytes contained in the data URL.
|
String |
getCharset()
Gets the charset information specified in the data URL.
|
String |
getDataAsString()
Gets the text content of the data URL.
|
String |
getMediaType()
Gets the media type information contained in the data URL.
|
public static DataUrlDecoder decode(URL url) throws UnsupportedEncodingException, org.apache.commons.codec.DecoderException
url
- the URL to decodeDataUrlDecoder
holding decoded informationUnsupportedEncodingException
- if the encoding specified by the data URL is invalid or not
available on the JVMorg.apache.commons.codec.DecoderException
- if decoding didn't successpublic static DataUrlDecoder decodeDataURL(String url) throws UnsupportedEncodingException, org.apache.commons.codec.DecoderException
url
- the string representation of the URL to decodeDataUrlDecoder
holding decoded informationUnsupportedEncodingException
- if the encoding specified by the data URL is invalid or not
available on the JVMorg.apache.commons.codec.DecoderException
- if decoding didn't successpublic String getMediaType()
public String getCharset()
public byte[] getBytes()
public String getDataAsString() throws UnsupportedEncodingException
UnsupportedEncodingException
- if decoding failed using the specified charsetCopyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.