|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--netx.jnlp.cache.CacheUtil
Provides static methods to interact with the cache, download indicator, and other utility methods.
Constructor Summary | |
CacheUtil()
|
Method Summary | |
static java.net.URL |
getCachedResource(java.net.URL location,
Version version,
UpdatePolicy policy)
Caches a resource and returns a URL for it in the cache; blocks until resource is cached. |
static java.io.File |
getLocalFile(java.net.URL source,
Version version)
Returns the file of the locally cached contents of the source. |
static java.io.OutputStream |
getOutputStream(java.net.URL source,
Version version)
Returns a buffered output stream open for writing to the cache file. |
static java.security.Permission |
getReadPermission(java.net.URL location,
Version version)
Returns the Permission object necessary to access the resource, or null if no permission is needed. |
static boolean |
isCacheable(java.net.URL source,
Version version)
Returns whether the resource can be cached as a local file; if not, then URLConnection.openStream can be used to obtain the contents. |
static boolean |
isCached(java.net.URL source,
Version version)
Returns true if the cache has a local copy of the contents of the URL matching the specified version string. |
static boolean |
isCurrent(java.net.URL source,
Version version,
java.net.URLConnection connection)
Returns whether there is a version of the URL contents in the cache and it is up to date. |
static boolean |
urlEquals(java.net.URL u1,
java.net.URL u2)
Compares a URL using string compare of its protocol, host, port, path, query, and anchor. |
static java.io.File |
urlToPath(java.net.URL location,
java.lang.String subdir)
Converts a URL into a local path string within the runtime's base directory. |
static void |
waitForResources(ApplicationInstance app,
ResourceTracker tracker,
java.net.URL[] resources,
java.lang.String title)
Waits until the resources are downloaded, while showing a progress indicator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CacheUtil()
Method Detail |
public static boolean urlEquals(java.net.URL u1, java.net.URL u2)
public static java.net.URL getCachedResource(java.net.URL location, Version version, UpdatePolicy policy)
location
- location of the resourceversion
- the version, or nullpublic static java.security.Permission getReadPermission(java.net.URL location, Version version)
public static boolean isCurrent(java.net.URL source, Version version, java.net.URLConnection connection)
source
- the source URLversion
- the versions to check forconnection
- a connection to the URL, or nulljava.lang.IllegalArgumentException
- if the source is not cacheablepublic static boolean isCached(java.net.URL source, Version version)
source
- the source URLversion
- the versions to check forjava.lang.IllegalArgumentException
- if the source is not cacheablepublic static boolean isCacheable(java.net.URL source, Version version)
public static java.io.File getLocalFile(java.net.URL source, Version version)
source
- the source URLversion
- the version id of the local filejava.lang.IllegalArgumentException
- if the source is not cacheablepublic static java.io.OutputStream getOutputStream(java.net.URL source, Version version) throws java.io.IOException
source
- the remote locationversion
- the file version to write topublic static java.io.File urlToPath(java.net.URL location, java.lang.String subdir)
location
- the urlsubdir
- subdirectory under the base directorypublic static void waitForResources(ApplicationInstance app, ResourceTracker tracker, java.net.URL[] resources, java.lang.String title)
tracker
- the resource trackerresources
- the resources to wait fortitle
- name of the download
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |