public class LocalFileCache
extends java.lang.Object
Constructor and Description |
---|
LocalFileCache(java.io.File directory)
Instantiates a new local file cache.
|
Modifier and Type | Method and Description |
---|---|
LocalFileCacheEntry |
addFileToCache(java.io.File localFile,
java.lang.String device)
Adds the file to cache.
|
LocalFileCacheEntry |
addFileToCacheWithName(java.io.File localFile,
java.lang.String fileName,
java.lang.String device)
Adds the file to cache with name.
|
boolean |
cacheContainsFileWithHashIdentity(MD5Hash id)
Cache contains file with hash identity.
|
static void |
destroyLocalFileCache(LocalFileCache cache)
Destroy local file cache.
|
java.io.File |
getCachedFileForHashIdentity(MD5Hash id)
Gets the cached file for hash identity.
|
public LocalFileCache(java.io.File directory)
directory
- the directorypublic static void destroyLocalFileCache(LocalFileCache cache)
cache
- the cachepublic LocalFileCacheEntry addFileToCache(java.io.File localFile, java.lang.String device) throws java.io.FileNotFoundException, java.io.IOException
localFile
- the local filedevice
- the devicejava.io.FileNotFoundException
- the file not found exceptionjava.io.IOException
- Signals that an I/O exception has occurred.public LocalFileCacheEntry addFileToCacheWithName(java.io.File localFile, java.lang.String fileName, java.lang.String device) throws java.io.IOException
localFile
- the local filefileName
- the file namedevice
- the devicejava.io.IOException
- Signals that an I/O exception has occurred.public boolean cacheContainsFileWithHashIdentity(MD5Hash id) throws java.io.IOException
id
- the idjava.io.IOException
- Signals that an I/O exception has occurred.public java.io.File getCachedFileForHashIdentity(MD5Hash id) throws java.io.IOException
id
- the idjava.io.IOException
- Signals that an I/O exception has occurred.