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

pack-priv final Class URLLoader

extends URLLoaderBase
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable
Imports
com.sun.javafx.PlatformUtil, com.sun.javafx.logging.PlatformLogger, .PlatformLogger.Level, com.sun.webkit.Invoker, .LoadListenerClient, .WebPage, java.io.EOFException, .File, .FileNotFoundException, .IOException, .InputStream, .OutputStream, .UnsupportedEncodingException, java.net.ConnectException, .HttpRetryException, .HttpURLConnection, .MalformedURLException, .NoRouteToHostException, .SocketException, .SocketTimeoutException, .URL, .URLConnection, .URLDecoder, .UnknownHostException, java.nio.ByteBuffer, java.util.List, .Locale, .Map, java.util.zip.GZIPInputStream, .InflaterInputStream, javax.net.ssl.SSLHandshakeException

A runnable that loads a resource specified by a URL.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
URLLoader.InvalidResponseException

Signals an invalid response from the server.

Field Summary

Modifier and TypeField and Description
private final boolean
private final ByteBufferPool
private volatile boolean
private final long
private static final String
private FormDataElement[]
private static final String
private static final String
private final String
private static final PlatformLogger
private static final int
private String
private String
private final WebPage
Inherited from com.sun.webkit.network.URLLoaderBase:
ALLOW_UNASSIGNED

Constructor Summary

AccessConstructor and Description
pack-priv
URLLoader(WebPage webPage, ByteBufferPool byteBufferPool, boolean asynchronous, String url, String method, String headers, FormDataElement[] formDataElements, long data)

Creates a new URLLoader.

Method Summary

Modifier and TypeMethod and Description
private static String
adjustUrlForWebKit(String url)

Adjust a URL string for passing into WebKit.

private void
callBack(Runnable runnable)

private static void
close(URLConnection c)

Releases the resources that may be associated with a connection.

private void
didFail(final int errorCode, final String message)

private void
private void
didReceiveData(final ByteBuffer byteBuffer, final ByteBufferAllocator allocator)

private void
private void
didSendData(final long totalBytesSent, final long totalBytesToBeSent)

private static String
extractContentEncoding(URLConnection c)

Given a URLConnection, returns the content encoding for passing into native callbacks.

private static long
extractContentLength(URLConnection c)

Given a URLConnection, returns the content length for passing into native callbacks.

private static String
extractHeaders(URLConnection c)

Given a URLConnection, returns the headers string for passing into native callbacks.

private static int
extractStatus(URLConnection c)

Given a URLConnection, returns the connection status for passing into native callbacks.

public void
fwkCancel()

Implements abstract com.sun.webkit.network.URLLoaderBase.fwkCancel.

Cancels this loader.

private void
notifyDidFail(int errorCode, String url, String message)

private void
private void
notifyDidReceiveData(ByteBuffer byteBuffer, int position, int remaining)

private void
notifyDidReceiveResponse(int status, String contentType, String contentEncoding, long contentLength, String headers, String url)

private void
notifyDidSendData(long totalBytesSent, long totalBytesToBeSent)

private void
notifyWillSendRequest(int status, String contentType, String contentEncoding, long contentLength, String headers, String url)

private void
prepareConnection(URLConnection c)

Prepares a connection.

private void
receiveResponse(URLConnection c)

Receives response from the server.

public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

private void
sendRequest(URLConnection c, boolean streaming)

Sends request to the server.

private void
private static void
Inherited from com.sun.webkit.network.URLLoaderBase:
twkDidFailtwkDidFinishLoadingtwkDidReceiveDatatwkDidReceiveResponsetwkDidSendDatatwkWillSendRequest

Field Detail

asynchronousback to summary
private final boolean asynchronous
byteBufferPoolback to summary
private final ByteBufferPool byteBufferPool
canceledback to summary
private volatile boolean canceled
databack to summary
private final long data
DELETEback to summary
private static final String DELETE
formDataElementsback to summary
private FormDataElement[] formDataElements
GETback to summary
private static final String GET
headersback to summary
private final String headers
loggerback to summary
private static final PlatformLogger logger
MAX_BUF_COUNTback to summary
private static final int MAX_BUF_COUNT
methodback to summary
private String method
urlback to summary
private String url
webPageback to summary
private final WebPage webPage

Constructor Detail

URLLoaderback to summary
pack-priv URLLoader(WebPage webPage, ByteBufferPool byteBufferPool, boolean asynchronous, String url, String method, String headers, FormDataElement[] formDataElements, long data)

Creates a new URLLoader.

Method Detail

adjustUrlForWebKitback to summary
private static String adjustUrlForWebKit(String url)

Adjust a URL string for passing into WebKit.

callBackback to summary
private void callBack(Runnable runnable)
closeback to summary
private static void close(URLConnection c)

Releases the resources that may be associated with a connection.

didFailback to summary
private void didFail(final int errorCode, final String message)
didFinishLoadingback to summary
private void didFinishLoading()
didReceiveDataback to summary
private void didReceiveData(final ByteBuffer byteBuffer, final ByteBufferAllocator allocator)
didReceiveResponseback to summary
private void didReceiveResponse(URLConnection c)
didSendDataback to summary
private void didSendData(final long totalBytesSent, final long totalBytesToBeSent)
extractContentEncodingback to summary
private static String extractContentEncoding(URLConnection c)

Given a URLConnection, returns the content encoding for passing into native callbacks.

extractContentLengthback to summary
private static long extractContentLength(URLConnection c)

Given a URLConnection, returns the content length for passing into native callbacks.

extractHeadersback to summary
private static String extractHeaders(URLConnection c)

Given a URLConnection, returns the headers string for passing into native callbacks.

extractStatusback to summary
private static int extractStatus(URLConnection c)

Given a URLConnection, returns the connection status for passing into native callbacks.

fwkCancelback to summary
public void fwkCancel()

Implements abstract com.sun.webkit.network.URLLoaderBase.fwkCancel.

Cancels this loader.

Annotations
@Override
notifyDidFailback to summary
private void notifyDidFail(int errorCode, String url, String message)
notifyDidFinishLoadingback to summary
private void notifyDidFinishLoading()
notifyDidReceiveDataback to summary
private void notifyDidReceiveData(ByteBuffer byteBuffer, int position, int remaining)
notifyDidReceiveResponseback to summary
private void notifyDidReceiveResponse(int status, String contentType, String contentEncoding, long contentLength, String headers, String url)
notifyDidSendDataback to summary
private void notifyDidSendData(long totalBytesSent, long totalBytesToBeSent)
notifyWillSendRequestback to summary
private void notifyWillSendRequest(int status, String contentType, String contentEncoding, long contentLength, String headers, String url)
prepareConnectionback to summary
private void prepareConnection(URLConnection c) throws IOException

Prepares a connection.

receiveResponseback to summary
private void receiveResponse(URLConnection c) throws IOException, InterruptedException

Receives response from the server.

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
sendRequestback to summary
private void sendRequest(URLConnection c, boolean streaming) throws IOException

Sends request to the server.

willSendRequestback to summary
private void willSendRequest(URLConnection c)
workaround7177996back to summary
private static void workaround7177996(URL url) throws FileNotFoundException
com.sun.webkit.network back to summary

private final Class URLLoader.InvalidResponseException

extends IOException
Class Inheritance

Signals an invalid response from the server.

Constructor Summary

AccessConstructor and Description
private

Constructor Detail

InvalidResponseExceptionback to summary
private InvalidResponseException()