APIdia Launch Partner
Top Description Fields Constructors Methods
sun.net.www.protocol.jrt

public Class JavaRuntimeURLConnection

extends URLConnection
Class Inheritance
Imports
java.io.ByteArrayInputStream, .IOException, .InputStream, .UncheckedIOException, java.net.MalformedURLException, .URL, jdk.internal.jimage.ImageReader, .ImageReader.Node, .SystemImageReader, sun.net.www.ParseUtil, .URLConnection

URLConnection implementation that can be used to connect to resources contained in the runtime image. See section "New URI scheme for naming stored modules, classes, and resources" in JEP 220.

Field Summary

Modifier and TypeField and Description
private final String
private final String
private static final ImageReader
private ImageReader.Node
Inherited from sun.net.www.URLConnection:
properties

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.

private synchronized ImageReader.Node
connectResourceNode()

Finds and caches the resource node associated with this URL and marks the connection as "connected".

public int
getContentLength()

Overrides sun.net.www.URLConnection.getContentLength.

Call this routine to get the content-length associated with this object.

public long
getContentLengthLong()

Overrides java.net.URLConnection.getContentLengthLong.

Returns the value of the content-length header field as a long.

public InputStream
getInputStream()

Overrides java.net.URLConnection.getInputStream.

Returns an input stream that reads from this open connection.

private static String
Inherited from sun.net.www.URLConnection:
addRequestPropertycanCachecloseensureCanServeHeadersgetContentTypegetHeaderFieldgetHeaderFieldgetHeaderFieldKeygetHeaderFieldsgetPropertiesgetRequestPropertiesgetRequestPropertyisProxiedHostsetContentLengthsetContentTypesetPropertiessetProxiedHostsetRequestProperty

Field Detail

moduleback to summary
private final String module
pathback to summary
private final String path
READERback to summary
private static final ImageReader READER
resourceNodeback to summary
private ImageReader.Node resourceNode

Constructor Detail

JavaRuntimeURLConnectionback to summary
pack-priv JavaRuntimeURLConnection(URL url) throws IOException

Method Detail

connectback to summary
public void connect() throws IOException

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
Exceptions
IOException:
if an I/O error occurs while opening the connection.
connectResourceNodeback to summary
private synchronized ImageReader.Node connectResourceNode() throws IOException

Finds and caches the resource node associated with this URL and marks the connection as "connected".

getContentLengthback to summary
public int getContentLength()

Overrides sun.net.www.URLConnection.getContentLength.

Doc from sun.net.www.URLConnection.getContentLength.

Call this routine to get the content-length associated with this object.

Annotations
@Override
getContentLengthLongback to summary
public long getContentLengthLong()

Overrides java.net.URLConnection.getContentLengthLong.

Doc from java.net.URLConnection.getContentLengthLong.

Returns the value of the content-length header field as a long.

Annotations
@Override
getInputStreamback to summary
public InputStream getInputStream() throws IOException

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
Exceptions
IOException:
if an I/O error occurs while creating the input stream.
percentDecodeback to summary
private static String percentDecode(String path) throws MalformedURLException