gov.nasa.worldwind.cache
Class AbstractFileCache
java.lang.Object
gov.nasa.worldwind.cache.AbstractFileCache
- All Implemented Interfaces:
- FileCache
- Direct Known Subclasses:
- BasicDataFileCache
public class AbstractFileCache
- extends java.lang.Object
- implements FileCache
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractFileCache
public AbstractFileCache()
addCacheLocation
public void addCacheLocation(int index,
java.lang.String newPath)
- Specified by:
addCacheLocation
in interface FileCache
addCacheLocation
public void addCacheLocation(java.lang.String newPath)
- Specified by:
addCacheLocation
in interface FileCache
contains
public boolean contains(java.lang.String fileName)
- Specified by:
contains
in interface FileCache
findFile
public java.net.URL findFile(java.lang.String fileName,
boolean checkClassPath)
- Specified by:
findFile
in interface FileCache
- Parameters:
fileName
- the name of the file to findcheckClassPath
- if true
, the class path is first searched for the file, otherwise the class
path is not searched unless it's one of the explicit paths in the cache search directories
- Returns:
- a handle to the requested file if it exists in the cache, otherwise null
- Throws:
java.lang.IllegalArgumentException
- if fileName
is null
getCacheLocations
public java.util.List<java.io.File> getCacheLocations()
- Specified by:
getCacheLocations
in interface FileCache
getWriteLocation
public java.io.File getWriteLocation()
- Specified by:
getWriteLocation
in interface FileCache
initialize
protected void initialize(java.io.InputStream xmlConfigStream)
newFile
public java.io.File newFile(java.lang.String fileName)
- Specified by:
newFile
in interface FileCache
- Parameters:
fileName
- the name to give the newly created file
- Returns:
- a handle to the newly created file if it could be created and added to the cache, otherwise null
- Throws:
java.lang.IllegalArgumentException
- if fileName
is null
removeCacheLocation
public void removeCacheLocation(java.lang.String newPath)
- Specified by:
removeCacheLocation
in interface FileCache
removeFile
public void removeFile(java.net.URL url)
- Specified by:
removeFile
in interface FileCache
- Parameters:
url
- the "file:" URL of the file to remove from the cache
- Throws:
java.lang.IllegalArgumentException
- if url
is null