at.spardat.xma.boot.cache
Class FileCacheStore

java.lang.Object
  extended byat.spardat.xma.boot.cache.FileCacheStore

public class FileCacheStore
extends java.lang.Object

file storage of the file cache

Since:
1.3.0

Method Summary
 FCResource findPreviousVersion(java.io.File file)
          Find the latest previous version of the given file.
 FCResource getResource(java.io.File resourceFile, java.net.URL urlRemote)
          Retrieve a resource from the cache.
 FCResource storeResource(java.io.File file, Result result, byte[] content, java.net.URL urlRemote, boolean bmode)
          Put a resource into the cache.
 FCResource storeResource(java.io.File file, Result result, java.net.URL urlRemote, IFileCacheResource temp, boolean bmode, boolean bforce)
          Put a resource into the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getResource

public FCResource getResource(java.io.File resourceFile,
                              java.net.URL urlRemote)
Retrieve a resource from the cache.

Parameters:
resourceFile - the File to retrieve
urlRemote - the ULR of the resource on the server
Returns:
the found resource or null if it is not allready cached.

storeResource

public FCResource storeResource(java.io.File file,
                                Result result,
                                java.net.URL urlRemote,
                                IFileCacheResource temp,
                                boolean bmode,
                                boolean bforce)
                         throws java.io.IOException
Put a resource into the cache.

Parameters:
file - to write the content into
result - content of the resource as received from the server
urlRemote - of the content on the server
temp - old expired version of the resource if exists in the cache
bmode - if true the content of the resource file is read into memory imeditately
bforce - indicates if an update of the resource was forced
Throws:
java.io.IOException - containing the filename

storeResource

public FCResource storeResource(java.io.File file,
                                Result result,
                                byte[] content,
                                java.net.URL urlRemote,
                                boolean bmode)
                         throws java.io.IOException
Put a resource into the cache.

Parameters:
file - to write the content into
result - the resource as received from the server
content - to store into the file
urlRemote - of the content on the server
bmode - if true the content of the resource file is read into memory imeditately
Throws:
java.io.IOException - containing the filename

findPreviousVersion

public FCResource findPreviousVersion(java.io.File file)
Find the latest previous version of the given file. This is the file with the same name containing the greatest version number less than the the version of the given file. If the name of the file does not contain a valid version number, nothing will be found. If there are more than one file with the same version number but different hash values, they will be ignored.

Parameters:
file - for which to search the previous version
Returns:
the found resource or null.