Class Resource
java.lang.Object
net.adoptopenjdk.icedteaweb.resources.Resource
Information about a single resource to download. This class tracks the downloading of various resources of a JNLP file to local files. It can be used to download icons, jnlp and extension files, jars, and jardiff files using the version based protocol or any file using the basic download protocol.
Resources can be put into download groups by specifying a part name for the resource. The resource tracker can also be configured to prefetch resources, which are downloaded in the order added to the media tracker.
- Version:
- $Revision: 1.9 $
- Author:
- Jon A. Maxwell (JAM) - initial author
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) booleanbooleanReturns the remote location of the resource.longgetSize()Returns the size of the resourceinthashCode()voidsetLocalFile(File localFile) Sets the local file to be downloadedvoidsetSize(long size) Sets the size of the resourcevoidsetStatus(ResourceStatus status) Changes the status.voidsetTransferred(long transferred) Sets the amount transferredtoString()
-
Field Details
-
SIZE_PROPERTY
- See Also:
-
TRANSFERRED_PROPERTY
- See Also:
-
-
Method Details
-
addPropertyChangeListener
-
addPropertyChangeListener
-
getLocation
Returns the remote location of the resource.- Returns:
- the same location as the one with which this resource was created
-
setLocalFile
Sets the local file to be downloaded- Parameters:
localFile- location of stored resource
-
getRequestVersion
- Returns:
- the requested version
-
setTransferred
public void setTransferred(long transferred) Sets the amount transferred- Parameters:
transferred- set the whole transferred amount to this value
-
getSize
public long getSize()Returns the size of the resource- Returns:
- size of resource (-1 if unknown)
-
setSize
public void setSize(long size) Sets the size of the resource- Parameters:
size- desired size of resource
-
getUpdatePolicy
- Returns:
- the update policy for this resource
-
forceUpdateRequested
public boolean forceUpdateRequested() -
setStatus
Changes the status.- Parameters:
status- a collection of status flags to set
-
getDownloadOptions
-
hashCode
public int hashCode() -
equals
-
toString
-
getSimpleName
-