Class DefaultDocumentRequestHandler
- All Implemented Interfaces:
AsyncDocumentRequestHandler, DocumentRequestHandler
- Direct Known Subclasses:
AsyncDocumentRequestHandlerImpl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourcesAllows URL's referring to a res:// local resource to default to this filebooleanAllows tracking whether a URL was visited or notresourceRequested(DocumentInfo docInfo) Implementations should return the document in the requested url as an InputStream This is triggered only for the main document requested and not for its resources.voidresourceRequestedAsync(DocumentInfo docInfo, IOCallback callback) This method is called by HTMLComponent when a resource is requested asynchronously.static voidsetResFile(Resources res) Allows URL's referring to a local:// local resource to default to this filevoidsetTrackVisitedURLs(boolean trackVisitedURLs) Allows tracking whether a URL was visited or notprotected voidvisitingURL(String url) This method can be invoked to indicate a URL was visited fro trackingbooleanwasURLVisited(String url) Returns true if the URL was visited, requires trackVisitedURLs to be true
-
Constructor Details
-
DefaultDocumentRequestHandler
public DefaultDocumentRequestHandler()
-
-
Method Details
-
getResFile
Allows URL's referring to a res:// local resource to default to this file
Returns
the resFile
-
setResFile
Allows URL's referring to a local:// local resource to default to this file
Parameters
res: the resource
-
resourceRequestedAsync
This method is called by HTMLComponent when a resource is requested asynchronously. This method should return immediately and start a process of fetching the requested resource on another thread. When the resource was fetched, the HTMLComponent.streamReady should be called.
Parameters
-
docInfo: A DocumentInfo object representing the requested URL and its attributes -
callback: The HTMLComponent that should be called back when the stream was fetched.
- Specified by:
resourceRequestedAsyncin interfaceAsyncDocumentRequestHandler
-
-
resourceRequested
Implementations should return the document in the requested url as an InputStream This is triggered only for the main document requested and not for its resources.
Parameters
docInfo: A DocumentInfo object representing the requested URL and its attributes
Returns
the document at the URL as an InputStream
- Specified by:
resourceRequestedin interfaceDocumentRequestHandler
-
visitingURL
This method can be invoked to indicate a URL was visited fro tracking
Parameters
url: the url
-
wasURLVisited
Returns true if the URL was visited, requires trackVisitedURLs to be true
Parameters
url: the url
Returns
true if it was visited
-
isTrackVisitedURLs
public boolean isTrackVisitedURLs()Allows tracking whether a URL was visited or not
Returns
the trackVisitedURLs
-
setTrackVisitedURLs
public void setTrackVisitedURLs(boolean trackVisitedURLs) Allows tracking whether a URL was visited or not
Parameters
trackVisitedURLs: the trackVisitedURLs to set
-