|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.ontopia.infoset.utils.DiskPreloader
public class DiskPreloader
INTERNAL: A preloader that stores its preloaded documents on the file system.
The preloader also implements LocatorReaderFactoryIF because it is capable of creating readers from the locators returned by its preload method.
This class is able to cache the result of preloaded locators. Caching is on by default. The caching is useful to avoid duplicate preloads of identical locators.
A URLLocatorReaderFactory is used by default if not specified in the constructor.
Field Summary | |
---|---|
protected boolean |
force_download
|
protected LocatorReaderFactoryIF |
lrf
|
protected java.lang.String |
preloader_path
|
Constructor Summary | |
---|---|
DiskPreloader(java.lang.String preloader_path)
|
|
DiskPreloader(java.lang.String preloader_path,
LocatorReaderFactoryIF lrf)
|
Method Summary | |
---|---|
protected LocatorIF |
createLocator(java.lang.String fileid)
|
java.io.Reader |
createReader(LocatorIF locator)
INTERNAL: Returns a reader that can read the contents of the resource referenced by the locator. |
protected java.lang.String |
getFileId(LocatorIF locator)
|
protected java.lang.String |
getFilename(java.lang.String fileid)
|
boolean |
getForceDownload()
PUBLIC: Returns true if the preloader shouldn't use its internal cache, but rather force a new preload. |
java.lang.String |
getPreloaderPath()
PUBLIC: Returns the directory in which the preloaded resources will be stored. |
protected java.io.Reader |
getReader(java.net.URL url)
|
boolean |
needsPreloading(LocatorIF locator)
INTERNAL: Can be used to figure out if it is necessary to preload the resource referenced by the locator. |
LocatorIF |
preload(LocatorIF locator)
PUBLIC: Preloads the resource pointed to by the given locator. |
void |
setForceDownload(boolean force_download)
PUBLIC: Sets the force download flag. |
void |
setPreloaderPath(java.lang.String preloader_path)
PUBLIC: Sets the directory in which the preloaded resources will be stored. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected LocatorReaderFactoryIF lrf
protected java.lang.String preloader_path
protected boolean force_download
Constructor Detail |
---|
public DiskPreloader(java.lang.String preloader_path)
public DiskPreloader(java.lang.String preloader_path, LocatorReaderFactoryIF lrf)
Method Detail |
---|
public boolean getForceDownload()
true
.
public void setForceDownload(boolean force_download)
public java.lang.String getPreloaderPath()
public void setPreloaderPath(java.lang.String preloader_path)
protected java.lang.String getFileId(LocatorIF locator)
protected java.lang.String getFilename(java.lang.String fileid)
protected java.io.Reader getReader(java.net.URL url) throws java.io.IOException
java.io.IOException
protected LocatorIF createLocator(java.lang.String fileid)
public LocatorIF preload(LocatorIF locator) throws java.io.IOException
preload
in interface PreloaderIF
java.io.IOException
public boolean needsPreloading(LocatorIF locator)
PreloaderIF
needsPreloading
in interface PreloaderIF
public java.io.Reader createReader(LocatorIF locator) throws java.io.IOException
LocatorReaderFactoryIF
createReader
in interface LocatorReaderFactoryIF
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |