|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.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 String |
preloader_path
|
| Constructor Summary | |
|---|---|
DiskPreloader(String preloader_path)
|
|
DiskPreloader(String preloader_path,
LocatorReaderFactoryIF lrf)
|
|
| Method Summary | |
|---|---|
protected LocatorIF |
createLocator(String fileid)
|
Reader |
createReader(LocatorIF locator)
INTERNAL: Returns a reader that can read the contents of the resource referenced by the locator. |
protected String |
getFileId(LocatorIF locator)
|
protected String |
getFilename(String fileid)
|
boolean |
getForceDownload()
PUBLIC: Returns true if the preloader shouldn't use its internal cache, but rather force a new preload. |
String |
getPreloaderPath()
PUBLIC: Returns the directory in which the preloaded resources will be stored. |
protected Reader |
getReader(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(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 String preloader_path
protected boolean force_download
| Constructor Detail |
|---|
public DiskPreloader(String preloader_path)
public DiskPreloader(String preloader_path,
LocatorReaderFactoryIF lrf)
| Method Detail |
|---|
public boolean getForceDownload()
true.
public void setForceDownload(boolean force_download)
public String getPreloaderPath()
public void setPreloaderPath(String preloader_path)
protected String getFileId(LocatorIF locator)
protected String getFilename(String fileid)
protected Reader getReader(URL url)
throws IOException
IOExceptionprotected LocatorIF createLocator(String fileid)
public LocatorIF preload(LocatorIF locator)
throws IOException
preload in interface PreloaderIFIOExceptionpublic boolean needsPreloading(LocatorIF locator)
PreloaderIF
needsPreloading in interface PreloaderIF
public Reader createReader(LocatorIF locator)
throws IOException
LocatorReaderFactoryIF
createReader in interface LocatorReaderFactoryIFIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||