|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.aduna.gee.publication.net.InputHandler
public class InputHandler
Central point for loading the files.
These are the files that are of particular importance
to content extractors (i.e. Session).
In addition sharing of downloaded files is supported.
Note: InputHandler's MUST be closed in order to enable GC.
| Field Summary | |
|---|---|
protected Vector |
_listeners
The interested audience. |
Cache |
cache
The cache |
WURL |
location
The location this input handler operates on |
static long |
maxZPadTimesAge
The maximum delay of ZPadTimes for the current server. |
Random |
random
My random generator, used by associated outputHandlers too. |
static WProperties |
redirections
the session wide known lists of redirections. |
static Hashtable |
theZPadTimes
The shared times of all files of all locations |
static Vector |
zpadsVisited
the list of all ZPad's ever visited. |
| Fields inherited from interface info.aduna.gee.publication.net.IOListener |
|---|
CACHE_UPDATE, LOGIN_ADDED, PASSWORD_ERROR, QUEUE_UPDATE, SHOW_OBJECT, STORE_DONE, STORE_STARTED |
| Fields inherited from interface info.aduna.gee.publication.net.FileNames |
|---|
ASA_FILE_NAME, BAK_FILE_NAME, CAT_FILE_NAME, CFG_FILE_NAME, CHS_FILE_NAME, DAT_FILE_NAME, HLP_FILE_NAME, LOCAL_FILE_PREFIX, SBS_FILE_NAME, SSS_FILE_NAME, WIF_FILE_NAME |
| Constructor Summary | |
|---|---|
InputHandler(WURL location)
Creates a new InputHandler. |
|
| Method Summary | |
|---|---|
protected void |
_load(WStorable object,
String filename,
boolean checkCaches,
boolean reload)
|
protected void |
_loadZpadTimes(long maxDelay)
Load the file time information. |
void |
addListener(IOListener listener)
Add a listener to the audience. |
void |
close()
Remove this InputHandler completely. |
boolean |
fileExists(String fileName)
This a generic function to check the existence of a file, without actually loading its full contents. |
boolean |
fileExists(String filename,
long maxDelay,
boolean allowDefaultHandling,
boolean ifUnknown)
Knowledge based on the ZpadTimes.html, therefore this file can be used ONLY for user's files. |
CLabelDefinitions |
getCLabelDefinitions()
Get the CLabelDefinitions from the Cache. |
Config |
getConfig()
Get the Config file from the cache. |
URLConnection |
getConnection(String filename)
Get a connection to a file. |
Database |
getDatabase(String filename)
Get a content database from the cache. |
InputStream |
getInputStream(String filename)
Get an inputstream on a file. |
long |
getModificationTime(String filename,
long maxDelay)
Get the modification time of a file or 0 if not known. |
SubscriptionDefinitions |
getSubscriptionDefinitions(String filename)
Get the SubscriptionDefinitions from the Cache. |
void |
ioStateChanged(WURL cacheLocation,
int info,
String filename,
Object arg)
Implements listener interface IOListener. |
CLabelDefinitions |
loadCLabelDefinitions()
Loads the CLabelDefinitions. |
Config |
loadConfig()
Loads the configuration. |
Database |
loadDatabase(String filename)
Loads a content database from file filename |
String |
loadFile(String fileName,
boolean doCache)
A generic function to load a text file. |
static InputStream |
loadFrom(InputStream input,
WStorable object)
|
Generator |
loadGenerator(InputHandler shareInput)
Loads the wif file. |
ZContainer |
loadImport(Entry entry)
Load the Entries represented by the IMPORT entry. |
Local |
loadLocal(String language)
Load the localized string database. |
SubscriptionDefinitions |
loadSubscriptionDefinitions(String filename)
Loads the SubscriptionDefinitions. |
void |
onException(WURL location,
Exception e,
String filename)
Called when the store requested encountered an io exception. |
void |
reload(String fileName)
Reloads an already loaded storable object. |
void |
removeListener(IOListener listener)
Remove a listener from the audience. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static long maxZPadTimesAge
public static Hashtable theZPadTimes
public static WProperties redirections
public static Vector zpadsVisited
public WURL location
public Cache cache
protected Vector _listeners
public Random random
| Constructor Detail |
|---|
public InputHandler(WURL location)
location - The ZPad location to transfer from.| Method Detail |
|---|
public InputStream getInputStream(String filename)
throws IOException
filename - the name of the file to open the input stream on.
IOException
public URLConnection getConnection(String filename)
throws IOException
filename - the file's name
IOException
public void reload(String fileName)
throws IOException
fileName - the name of the file to reload.
IOException
protected void _load(WStorable object,
String filename,
boolean checkCaches,
boolean reload)
throws IOException
checkCaches - whether or not to check the ZPad, Browser and Proxy caches.
Note: we only forceLoad once and don't check again (and again).reload - do a forced reload
IOException
public Config loadConfig()
throws IOException
IOException - when an I/O error occurrs while
reading the configuration.public CLabelDefinitions getCLabelDefinitions()
public CLabelDefinitions loadCLabelDefinitions()
throws IOException
IOExceptionpublic SubscriptionDefinitions getSubscriptionDefinitions(String filename)
public SubscriptionDefinitions loadSubscriptionDefinitions(String filename)
public Local loadLocal(String language)
throws IOException
IOException - when an I/O error occurrs while loading.public Config getConfig()
public Generator loadGenerator(InputHandler shareInput)
throws IOException
IOException - when an I/O error occurrs.
public Database loadDatabase(String filename)
throws IOException
filename - the name of the file to load.
IOException - when an I/O error occurrs while reading
the database.#storeDatabasepublic Database getDatabase(String filename)
filename - the name of the file to get
public void addListener(IOListener listener)
listener - a new io listener.public void removeListener(IOListener listener)
listener - the listener to remove.public void close()
public void ioStateChanged(WURL cacheLocation,
int info,
String filename,
Object arg)
ioStateChanged in interface IOListenerinfo - the info being given.filename - the name of the file the info is about.arg - an optional argumentcacheLocation - the location
public void onException(WURL location,
Exception e,
String filename)
IOListener
onException in interface IOListenerlocation - the locatione - the encountered exception.filename - the name of the file the info is about.protected void _loadZpadTimes(long maxDelay)
public long getModificationTime(String filename,
long maxDelay)
filename - the name of the file for which to get the Modification TimemaxDelay - the max age in seconds (!) of the Modification Time. If older, get new ones first.
public boolean fileExists(String filename,
long maxDelay,
boolean allowDefaultHandling,
boolean ifUnknown)
allowDefaultHandling - if true, interpret handling by the Zpad's server default behaviour as existing
if false, the file should physically existifUnknown - the result in case the existence of the file is unknown (based on ZPadTimes.html).
public String loadFile(String fileName,
boolean doCache)
fileName - the name (relative URL with respect to the current InputHandler's location) of the text file to loaddoCache - if true cache the result, if false don't
public ZContainer loadImport(Entry entry)
public boolean fileExists(String fileName)
public static InputStream loadFrom(InputStream input,
WStorable object)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||