org.jconfig.handler
Class URLHandler
java.lang.Object
|
+--org.jconfig.handler.URLHandler
- All Implemented Interfaces:
- ConfigurationHandler, java.util.EventListener, FileListener
- Direct Known Subclasses:
- ConfigServerHandler
- public class URLHandler
- extends java.lang.Object
- implements ConfigurationHandler, FileListener
This class will read the content from an URL and generate the
properties. If you have the need to use a proxy server, create
jconfig.properties file and place it inside your system path.
jconfig.properties example:
# jconfig.properties file
http.proxyHost=proxy.server.url
http.proxyPort=3128
- Author:
- Andreas Mecky andreas.mecky@xcom.de, Terry Dye terry.dye@xcom.de
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
URLHandler
public URLHandler()
setURL
public void setURL(java.lang.String url)
setValidation
public void setValidation(boolean validate)
- This defines if the file will be vaidated using a DTD. The default
is false.
- Parameters:
validate
- defines the validation
load
public Configuration load()
throws ConfigurationManagerException
- Throws:
ConfigurationManagerException
-
fileChanged
public void fileChanged(FileListenerEvent event)
- Description copied from interface:
FileListener
- This method, once implemented, will be called when the File object
itself changes.
- Specified by:
fileChanged
in interface FileListener
- Following copied from interface:
org.jconfig.event.FileListener
- Parameters:
FileListener
- The FileListener object.
load
public Configuration load(java.lang.String configName)
throws ConfigurationManagerException
- Description copied from interface:
ConfigurationHandler
- This method loads a configuration and returns it
- Specified by:
load
in interface ConfigurationHandler
- Parameters:
theURL
- Description of the Parameter- Throws:
ConfigurationManagerException
- if the file cannot be processed
load
protected Configuration load(java.lang.String theURL,
java.lang.String configName)
throws ConfigurationManagerException
store
public void store(Configuration configuration)
throws ConfigurationManagerException
- This method should store all categories and properties.
- Specified by:
store
in interface ConfigurationHandler
- Throws:
ConfigurationManagerException
-
addFileListener
public void addFileListener(FileListener fileListener)
getURL
public java.lang.String getURL()
Copyright © 2001-2003 Andreas Mecky, Terry Dye. All Rights Reserved.