|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mindswap.pellet.utils.Cache
public class Cache
Maps remote URI's to local cached files so {#link org.mindswap.pellet.jena.ModelReader# ModelReader} can use cached files when needed. Mappings can be added one by one or read from an index file. If the use of cache is forced then local file will be used by the reader even if the remote file is available. Otherwise, local files will only be used when the remote file cannot be read.
Constructor Summary | |
---|---|
Cache()
|
Method Summary | |
---|---|
void |
addCachedFile(java.lang.String fileURI,
java.lang.String localFile)
Add a local file to be used as a cached copy for the given URI. |
java.io.File |
getCachedFile(java.lang.String fileURI)
Returns the cached File object for the given URI. |
boolean |
isForced()
Returns if the using of cache is forced. |
void |
setForced(boolean b)
Forces the readers to use the cached copies of the files even if the remote file may be available. |
void |
setLocalCacheDirectory(java.lang.String dir)
Sets the cache dir for the inference engine to find the cached files when a file cannot be downparseed from its original URL. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Cache()
Method Detail |
---|
public void setForced(boolean b)
b
- public boolean isForced()
public void setLocalCacheDirectory(java.lang.String dir)
dir
- sets the local cache directory. if null it forces not to use the cache.
if the given dir or index file inthat dir does not exist then nothing is
donepublic java.io.File getCachedFile(java.lang.String fileURI)
fileURI
-
public void addCachedFile(java.lang.String fileURI, java.lang.String localFile)
fileURI
- URI for the remote filelocalFile
- Path for the local cached copy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |