public class ApplicationCache extends EventTarget
A collection of offline resources as defined in the HTML5 spec. Intended to support offline web applications.
Modifier and Type | Field and Description |
---|---|
static short |
STATUS_CHECKING
The application cache manifest is being fetched and checked for updates.
|
static short |
STATUS_DOWNLOADING
Resources are being downloaded to be added to the cache.
|
static short |
STATUS_IDLE
The application cache is not in the process of being updated.
|
static short |
STATUS_OBSOLETE
The application cache group is now obsolete.
|
static short |
STATUS_UNCACHED
The object isn't associated with an application cache.
|
static short |
STATUS_UPDATEREADY
There is a new version of the application cache available.
|
Constructor and Description |
---|
ApplicationCache()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String uri)
Adds an item to the dynamically managed entries.
|
void |
addEventListener(String type,
net.sourceforge.htmlunit.corejs.javascript.Scriptable listener,
boolean useCapture)
Allows the registration of event listeners on the event target.
|
boolean |
dispatchEvent(Event event)
Dispatches an event into the event system (standards-conformant browsers only).
|
int |
getLength()
Returns the number of entries in the dynamically managed offline resource list.
|
Object |
getOncached()
Returns the event listener to be called when caching is complete.
|
Object |
getOnchecking()
Returns the event listener to be called when fetching the application cache manifest and checking for updates.
|
Object |
getOndownloading()
Returns the event listener to be called when resources are being downloaded into the cache.
|
Object |
getOnerror()
Returns the event listener to be called when an error occurs during the caching process.
|
Object |
getOnnoupdate()
Returns the event listener to be called when there is no update to download.
|
Object |
getOnprogress()
Returns the event listener to be called periodically throughout the download process.
|
Object |
getOnupdateready()
Returns the event listener to be called when a resource update is ready.
|
short |
getStatus()
Returns the status of the application cache.
|
boolean |
hasItem(String uri)
Returns true if the specified URI represents a resource that's in the application cache's list.
|
String |
item(int index)
Returns the URI of the item at the specific offset into the list of cached resources.
|
void |
remove(String uri)
Removes an item from the list of dynamically managed entries.
|
void |
removeEventListener(String type,
net.sourceforge.htmlunit.corejs.javascript.Scriptable listener,
boolean useCapture)
Allows the removal of event listeners on the event target.
|
void |
setOncached(Object o)
Sets the event listener to be called when caching is complete.
|
void |
setOnchecking(Object o)
Sets the event listener to be called when fetching the application cache manifest and checking for updates.
|
void |
setOndownloading(Object o)
Sets the event listener to be called when resources are being downloaded into the cache.
|
void |
setOnerror(Object o)
Sets the event listener to be called when an error occurs during the caching process.
|
void |
setOnnoupdate(Object o)
Sets the event listener to be called when there is no update to download.
|
void |
setOnprogress(Object o)
Sets the event listener to be called periodically throughout the download process.
|
void |
setOnupdateready(Object o)
Sets the event listener to be called when a resource update is ready.
|
void |
swapCache()
Swaps in the newest version of the application cache.
|
void |
update()
Begins the application cache update process.
|
clearEventListenersContainer, dispatchEvent, executeEvent, fireEvent, getEventHandler, getEventHandlerProp, getEventListenersContainer, hasEventHandlers, removeEventListener, setEventHandler, setEventHandlerProp
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setClassName, setDomNode, setDomNode, setHtmlElement, setParentScope
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setPrototype, size
public static final short STATUS_UNCACHED
public static final short STATUS_IDLE
public static final short STATUS_CHECKING
public static final short STATUS_DOWNLOADING
public static final short STATUS_UPDATEREADY
public static final short STATUS_OBSOLETE
public Object getOnchecking()
public void setOnchecking(Object o)
o
- the event listener to be called when fetching the application cache manifest and checking for updatespublic Object getOnerror()
public void setOnerror(Object o)
o
- the event listener to be called when an error occurs during the caching processpublic Object getOnnoupdate()
public void setOnnoupdate(Object o)
o
- the event listener to be called when there is no update to downloadpublic Object getOndownloading()
public void setOndownloading(Object o)
o
- the event listener to be called when resources are being downloaded into the cachepublic Object getOnprogress()
public void setOnprogress(Object o)
o
- the event listener to be called periodically throughout the download processpublic Object getOnupdateready()
public void setOnupdateready(Object o)
o
- the event listener to be called when a resource update is readypublic Object getOncached()
public void setOncached(Object o)
o
- the event listener to be called when caching is completepublic void addEventListener(String type, net.sourceforge.htmlunit.corejs.javascript.Scriptable listener, boolean useCapture)
addEventListener
in class EventTarget
type
- the event type to listen for (like "onload")listener
- the event listeneruseCapture
- If true
, indicates that the user wishes to initiate capture (not yet implemented)public void removeEventListener(String type, net.sourceforge.htmlunit.corejs.javascript.Scriptable listener, boolean useCapture)
type
- the event type to listen for (like "load")listener
- the event listeneruseCapture
- If true
, indicates that the user wishes to initiate capture (not yet implemented)public boolean dispatchEvent(Event event)
event
- the event to be dispatchedpublic short getStatus()
public int getLength()
public void add(String uri)
uri
- the URI of the item to add to the dynamically managed entriespublic boolean hasItem(String uri)
uri
- the URI to checkpublic String item(int index)
index
- the index of the cached item whose URI should be returnedpublic void remove(String uri)
uri
- the URI to removepublic void swapCache()
public void update()
Copyright © 2002–2015 Gargoyle Software Inc.. All rights reserved.