|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.gargoylesoftware.htmlunit.protocol.data.DataUrlDecoder
public class DataUrlDecoder
Helper to work with data URLs.
| Constructor Summary | |
|---|---|
protected |
DataUrlDecoder(byte[] data,
String mediaType,
String charset)
C'tor. |
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected DataUrlDecoder(byte[] data,
String mediaType,
String charset)
data - the datamediaType - the media typecharset - the charset| Method Detail |
|---|
public static DataUrlDecoder decode(URL url)
throws UnsupportedEncodingException,
org.apache.commons.codec.DecoderException
url - the URL to decode
DataUrlDecoder holding decoded information
UnsupportedEncodingException - if the encoding specified by the data URL is invalid or not
available on the JVM
org.apache.commons.codec.DecoderException - if decoding didn't success
public static DataUrlDecoder decodeDataURL(String url)
throws UnsupportedEncodingException,
org.apache.commons.codec.DecoderException
url - the string representation of the URL to decode
DataUrlDecoder holding decoded information
UnsupportedEncodingException - if the encoding specified by the data URL is invalid or not
available on the JVM
org.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 charset
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||