org.alltimeflashdreamer.mailwebform
Class GlobalProperties

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byjava.util.Properties
              extended byorg.alltimeflashdreamer.mailwebform.GlobalProperties
All Implemented Interfaces:
Cloneable, MailWebFormConstants, Map, Serializable

public class GlobalProperties
extends Properties
implements MailWebFormConstants

Title: GlobalProperties
Description: Reloadable implementation of the java.util.Properties class, ready to return certain properties through specific accessor methods.

Version:
0.9
Author:
Copyright (c) 2001-2004 Florian Steinsiepe, Adrian Zaugg
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Hashtable
 
Field Summary
 
Fields inherited from class java.util.Properties
defaults
 
Fields inherited from interface org.alltimeflashdreamer.mailwebform.MailWebFormConstants
ADMIN, ADMINSERVLET, APPNAME, COOKIENAME, CURRENTUSER, ERROR_URL, FILESEPARATOR, JSPBEAN, MAILFORMPROVIDER, MAILFORMPROVIDERLIST, MAILWEBFORM, MAILWEBFORMSERVLET, NEWLINE, PARAM_ADD, PARAM_APPLYGLOBAL, PARAM_APPLYINDIVIDUAL, PARAM_CANCEL, PARAM_CHANGE_CREDENTIALS, PARAM_CONFIGFILE, PARAM_CREDENTIALS_ADMIN, PARAM_EDIT, PARAM_ERRORURL, PARAM_FROMEMAIL, PARAM_FROMNAME, PARAM_LOGIN, PARAM_LOGOUT, PARAM_OVERWRITE, PARAM_PASSWORD, PARAM_PASSWORD_PROVIDER, PARAM_PROVIDER, PARAM_PROVIDERDIRECTORY, PARAM_REMOVE, PARAM_SMTPHOST, PARAM_SMTPPORT, PARAM_SPAMURL, PARAM_STORE, PARAM_SUBJECT, PARAM_SUCCESSURL, PARAM_TEMPLATE, PARAM_TEXT, PARAM_TOADDRESS, PARAM_TONAME, PARAM_USERNAME, PASSWORD, PASSWORDFILE, PLACEHOLDER_END, PLACEHOLDER_START, PROPERTY_CONFIGDIR, PROPERTY_SUFFIX, PROVIDERDIRECTORY, RESOURCENAME, SITE_CHANGE_CREDENTIALS, SITE_DEFAULTFORM, SITE_EDIT, SITE_ERROR, SITE_FOOTER, SITE_HEADER, SITE_LOGIN, SITE_MAIN, SITE_PROVIDER, SMTP_ALLOWOVERWRITE, SMTP_HOST, SMTP_PORT, SPAMERROR_URL, SUCCESS_URL, SYSTEMPROVIDER, TEMPLATE, TEMPLATE_SUFFIX, TOADDRESS, TONAME, USERNAME
 
Constructor Summary
(package private) GlobalProperties(File propertyFile)
          Reads the contents of the specified property file into the internal list of properties.
 
Method Summary
(package private)  boolean checkReload(File propertyFile)
          Checks whether the save date of the property file has changed or not.
 String getErrorURL()
          Returns the global setting for the site that is shown in case of an unsuccessful delivery of the generated mail; may be unset.
 String getSMTPHost()
          Returns the global setting for the smtp server's host name.
 int getSMTPPort()
          Returns the global setting for the smtp server's port value.
 String getSpamErrorURL()
          Returns the global setting for the site that is shown in case of an illegal calling of the application (by hackers or spammers); may be unset.
 String getSuccessURL()
          Returns the global setting for the site that is shown in case of a successful delivery of the generated mail; may be unset.
(package private)  void setErrorURL(String sErrorURL)
          Adds or replaces the stored value for the error URL.
(package private)  void setSMTPHost(String sSMTPHost)
          Adds or replaces the stored value for the SMTP host.
(package private)  void setSMTPPort(int iSMTPPort)
          Adds or replaces the stored value for the SMTP port.
(package private)  void setSpamErrorURL(String sSpamErrorURL)
          Adds or replaces the stored value for the spam error URL.
(package private)  void setSuccessURL(String sSuccessURL)
          Adds or replaces the stored value for the success URL.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, propertyNames, save, setProperty, store
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GlobalProperties

GlobalProperties(File propertyFile)
           throws IOException
Reads the contents of the specified property file into the internal list of properties.

Parameters:
propertyFile - the file containing the properties, as specified by the java.util.Properties class
Throws:
IOException - if the reading of the file fails somehow
See Also:
checkReload(java.io.File)
Method Detail

checkReload

boolean checkReload(File propertyFile)
              throws IOException
Checks whether the save date of the property file has changed or not. If so, the list is emptied, the values are re-read, and true (i.e. action done) is returned, else nothing is done and false is returned.

Parameters:
propertyFile - the file containing the properties, as specified by the java.util.Properties class
Returns:
if the property file was (successfully) reloaded
Throws:
IOException - if the reading of the file fails somehow

getSMTPHost

public String getSMTPHost()
Returns the global setting for the smtp server's host name.

Returns:
the name of the default SMTP host to be used

setSMTPHost

void setSMTPHost(String sSMTPHost)
Adds or replaces the stored value for the SMTP host.

Parameters:
sSMTPHost - the (new) SMTP host name to be stored

getSMTPPort

public int getSMTPPort()
Returns the global setting for the smtp server's port value.

Returns:
the number of the default SMTP port to be used

setSMTPPort

void setSMTPPort(int iSMTPPort)
Adds or replaces the stored value for the SMTP port.

Parameters:
iSMTPPort - the (new) SMTP port number to be stored

getSuccessURL

public String getSuccessURL()
Returns the global setting for the site that is shown in case of a successful delivery of the generated mail; may be unset.

Returns:
the default success site to be shown or ""

setSuccessURL

void setSuccessURL(String sSuccessURL)
Adds or replaces the stored value for the success URL.

Parameters:
sSuccessURL - the (new) success URL to be stored

getErrorURL

public String getErrorURL()
Returns the global setting for the site that is shown in case of an unsuccessful delivery of the generated mail; may be unset.

Returns:
the default error site to be shown or ""

setErrorURL

void setErrorURL(String sErrorURL)
Adds or replaces the stored value for the error URL.

Parameters:
sErrorURL - the (new) error URL to be stored

getSpamErrorURL

public String getSpamErrorURL()
Returns the global setting for the site that is shown in case of an illegal calling of the application (by hackers or spammers); may be unset.

Returns:
the default spam error site to be shown or ""

setSpamErrorURL

void setSpamErrorURL(String sSpamErrorURL)
Adds or replaces the stored value for the spam error URL.

Parameters:
sSpamErrorURL - the (new) spam error URL to be stored