|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Interface to the file cache. Users of the file cache should always use it through this interface to stay apart of implementation details.
| Method Summary | |
boolean |
checkHash(IFileCacheResource resource,
java.lang.String hash,
boolean isJar)
Check the integrity of the given resource. |
java.io.File |
getBaseDir()
Get the directory where the file cache is located. |
void |
invalidateResource(IFileCacheResource ifcr)
call this method to remove (delete) all information of this cached resource. |
void |
invalidateResource(java.net.URL urlRemote)
invalidates a cache-entry if exists will invalidate all file-resources from the file cache directory for this url. |
boolean |
isCached(java.net.URL urlRemote)
Check if there is allready a local copy of this remote URL. |
boolean |
isCachedAndValid(IFileCacheResource resource,
java.lang.String hash)
Check if there is allready a local copy of the given resouce. |
boolean |
isCachedAndValid(XMA_URI uri,
java.lang.String hash)
Check if there is allready a local copy of the given resouce. |
IFileCacheResource |
openLocalResource(XMA_URI resource)
Open a resource from the local cache. |
IFileCacheResource |
openResource(IRtXMASessionClient session,
java.net.URL urlRemote)
This method will open a resource represented by a valid URL. |
IFileCacheResource |
openResource(java.net.URL urlRemote)
This method will open a resource represented by a valid URL. |
IFileCacheResource |
openResource(java.net.URL urlRemote,
boolean bmode)
This method will open a resource represented by a valid URL. |
IFileCacheResource |
openResource(java.net.URL urlRemote,
boolean bmode,
boolean bforce)
This method will open a resource represented by a valid URL. |
IFileCacheResource |
openResource(java.net.URL urlRemote,
boolean bmode,
boolean bforce,
IRtXMASessionClient session)
This method will open a resource represented by a valid URL. |
IFileCacheResource |
openResource(XMA_URI resource,
java.lang.String hash,
VersionNumber serverVers,
boolean bforce)
This method will open a resource represented by a valid XMA_URI. |
IFileCacheResource |
openResource(XMA_URI appUri,
XMAResource resource,
VersionNumber serverVers,
boolean bforce)
This method will open a resource represented by a valid XMAResource. |
| Method Detail |
public IFileCacheResource openResource(java.net.URL urlRemote)
throws java.io.IOException
URL.openResource(URL, boolean, boolean, IRtXMASessionClient) called
with (urlRemote, true, false, null).
urlRemote - remote url to open.
java.io.IOException - on filesystem errors
CommunicationException - communication error with server
ServerException - on server exception
java.lang.IllegalArgumentException - prepare a valid url
public IFileCacheResource openResource(IRtXMASessionClient session,
java.net.URL urlRemote)
throws java.io.IOException
URL.openResource(URL, boolean, boolean, IRtXMASessionClient) called
with (urlRemote, true, false, session).
session - xma session (or null)urlRemote - remote url to open.
java.io.IOException - on filesystem errors
CommunicationException - communication error with server
ServerException - on server exception
java.lang.IllegalArgumentException - prepare a valid url
public IFileCacheResource openResource(java.net.URL urlRemote,
boolean bmode,
boolean bforce)
throws java.io.IOException
URL.openResource(URL, boolean, boolean, IRtXMASessionClient) called
with (urlRemote, bmode, bforce, null).
urlRemote - remote url to open.bmode - use true for buffered mode.bforce - force an update check with the server
java.io.IOException - on filesystem errors
CommunicationException - communication error with server
ServerException - on server exception
java.lang.IllegalArgumentException - prepare a valid url
public IFileCacheResource openResource(java.net.URL urlRemote,
boolean bmode)
throws java.io.IOException
URL.openResource(URL, boolean, boolean, IRtXMASessionClient) called
with (urlRemote, bmode, false, null).
urlRemote - remote url to open.bmode - use true for buffered mode.
java.io.IOException - on filesystem errors
CommunicationException - communication error with server
ServerException - on server exception
java.lang.IllegalArgumentException - prepare a valid url
public IFileCacheResource openResource(java.net.URL urlRemote,
boolean bmode,
boolean bforce,
IRtXMASessionClient session)
throws java.io.IOException
URL.
urlRemote - remote url to open.bmode - read the cache entry, into a memory buffer imediately on object creationbforce - force an update check with the serversession - xma session (or null)
java.io.IOException - on filesystem errors
CommunicationException - communication error with server
ServerException - on server exception
java.lang.IllegalArgumentException - prepare a valid url
public IFileCacheResource openResource(XMA_URI appUri,
XMAResource resource,
VersionNumber serverVers,
boolean bforce)
throws java.io.IOException
XMAResource.XMAResource match the
hash of the cached resource.
appUri - uri of the xma applicationresource - the wanted resource inside this applicationserverVers - version number of the xma-runtime on the serverbforce - force an update check with the server
java.io.IOException - on filesystem errors
CommunicationException - communication error with server
ServerException - on server exception
java.lang.IllegalArgumentException - prepare a valid url
public IFileCacheResource openResource(XMA_URI resource,
java.lang.String hash,
VersionNumber serverVers,
boolean bforce)
throws java.io.IOException
XMA_URI.
resource - the wanted resourcehash - the expected hash value of the resouceserverVers - version number of the xma-runtime on the serverbforce - force an update check with the server
java.io.IOException - on filesystem errors
CommunicationException - communication error with server
ServerException - on server exception
java.lang.IllegalArgumentException - prepare a valid urlpublic IFileCacheResource openLocalResource(XMA_URI resource)
null is returned. The resource is not checked for expiration or integrity.
This method does not find shared resources.
resource - to open
null if not cached.
java.io.IOException - containing the filename on filesystem errors
public void invalidateResource(java.net.URL urlRemote)
throws java.io.IOException
invalidates a cache-entry if exists
will invalidate all file-resources from the file cache directory for this url.
urlRemote - the remote url that is the key to the cached resources
java.io.IOException - on file errorspublic void invalidateResource(IFileCacheResource ifcr)
ifcr - the resource to invalidatepublic boolean isCached(java.net.URL urlRemote)
urlRemote - remote URL to check for a local cached copy
java.lang.IllegalArgumentException - if the source is not cacheablepublic java.io.File getBaseDir()
public boolean isCachedAndValid(XMA_URI uri,
java.lang.String hash)
throws java.io.IOException
uri - defining the resourcehash - expected hash value of the resource
java.io.IOException
public boolean isCachedAndValid(IFileCacheResource resource,
java.lang.String hash)
resource - to checkhash - expected hash value of the resource
java.io.IOException
public boolean checkHash(IFileCacheResource resource,
java.lang.String hash,
boolean isJar)
resource - to checkhash - expected hash valueisJar - if the resource is a jar file or not
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||