Top Description Fields Constructors Methods
com.sun.webkit.network.data

pack-priv final Class DataURLConnection

extends URLConnection
Class Inheritance
Imports
java.io.ByteArrayInputStream, .IOException, .InputStream, .UnsupportedEncodingException, java.net.ProtocolException, .URL, .URLConnection, java.nio.charset.Charset, java.util.Base64, .LinkedList

Implementation of the data: protocol handler as specified by RFC 2397. Examples: data:image/gif;base64,R0lGODdhM.... data:text/plain;charset=iso-8859-7,%be%f9%be data:text/css,.picture%20%7B%20background%3A%20none%3B%20%7D data:application/x-unknown,ERROR
Author
jccollet

Field Summary

Modifier and TypeField and Description
private final byte[]
private final InputStream
private final String
private static final Charset
Inherited from java.net.URLConnection:
allowUserInteractionconnecteddoInputdoOutputifModifiedSinceurluseCaches

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
connect()

Implements abstract java.net.URLConnection.connect.

Opens a communications link to the resource referenced by this URL, if such a connection has not already been established.

public String
getContentEncoding()

Overrides java.net.URLConnection.getContentEncoding.

Returns the value of the content-encoding header field.

public int
getContentLength()

Overrides java.net.URLConnection.getContentLength.

Returns the value of the content-length header field.

public String
getContentType()

Overrides java.net.URLConnection.getContentType.

Returns the value of the content-type header field.

public InputStream
getInputStream()

Overrides java.net.URLConnection.getInputStream.

Returns an input stream that reads from this open connection.

private static String
urlDecode(String str, Charset charset)

Inherited from java.net.URLConnection:
addRequestPropertygetAllowUserInteractiongetConnectTimeoutgetContentgetContentgetContentLengthLonggetDategetDefaultAllowUserInteractiongetDefaultRequestPropertygetDefaultUseCachesgetDefaultUseCachesgetDoInputgetDoOutputgetExpirationgetFileNameMapgetHeaderFieldgetHeaderFieldgetHeaderFieldDategetHeaderFieldIntgetHeaderFieldKeygetHeaderFieldLonggetHeaderFieldsgetIfModifiedSincegetLastModifiedgetOutputStreamgetPermissiongetReadTimeoutgetRequestPropertiesgetRequestPropertygetURLgetUseCachesguessContentTypeFromNameguessContentTypeFromStreamsetAllowUserInteractionsetConnectTimeoutsetContentHandlerFactorysetDefaultAllowUserInteractionsetDefaultRequestPropertysetDefaultUseCachessetDefaultUseCachessetDoInputsetDoOutputsetFileNameMapsetIfModifiedSincesetReadTimeoutsetRequestPropertysetUseCachestoString

Field Detail

databack to summary
private final byte[] data
inputStreamback to summary
private final InputStream inputStream
mediaTypeback to summary
private final String mediaType
US_ASCIIback to summary
private static final Charset US_ASCII

Constructor Detail

DataURLConnectionback to summary
pack-priv DataURLConnection(URL url) throws IOException

Method Detail

connectback to summary
public void connect()

Implements abstract java.net.URLConnection.connect.

Doc from java.net.URLConnection.connect.

Opens a communications link to the resource referenced by this URL, if such a connection has not already been established.

If the connect method is called when the connection has already been opened (indicated by the connected field having the value true), the call is ignored.

URLConnection objects go through two phases: first they are created, then they are connected. After being created, and before being connected, various options can be specified (e.g., doInput and UseCaches). After connecting, it is an error to try to set them. Operations that depend on being connected, like getContentLength, will implicitly perform the connection, if necessary.

Annotations
@Override
getContentEncodingback to summary
public String getContentEncoding()

Overrides java.net.URLConnection.getContentEncoding.

Doc from java.net.URLConnection.getContentEncoding.

Returns the value of the content-encoding header field.

Annotations
@Override
getContentLengthback to summary
public int getContentLength()

Overrides java.net.URLConnection.getContentLength.

Doc from java.net.URLConnection.getContentLength.

Returns the value of the content-length header field.

Note

getContentLengthLong() should be preferred over this method, since it returns a long instead and is therefore more portable.

Annotations
@Override
getContentTypeback to summary
public String getContentType()

Overrides java.net.URLConnection.getContentType.

Doc from java.net.URLConnection.getContentType.

Returns the value of the content-type header field.

Annotations
@Override
getInputStreamback to summary
public InputStream getInputStream()

Overrides java.net.URLConnection.getInputStream.

Doc from java.net.URLConnection.getInputStream.

Returns an input stream that reads from this open connection. A SocketTimeoutException can be thrown when reading from the returned input stream if the read timeout expires before data is available for read.

Annotations
@Override
urlDecodeback to summary
private static String urlDecode(String str, Charset charset)