org.alltimeflashdreamer.filelister
Class PropertyFileParameters

java.lang.Object
  extended byorg.alltimeflashdreamer.filelister.PropertyFileParameters
All Implemented Interfaces:
Serializable

public class PropertyFileParameters
extends Object
implements Serializable

Title: PropertyFileParameters

Description: This class stores the values of the property file, for easy handling by the FileListerConfig and the PoolHandler/ConnectionPool classes.

Organization: All Time Flash Dreamer

Version:
0.5.1
Author:
Copyright (c) 2002-2004 by Florian Steinsiepe
See Also:
Serialized Form

Field Summary
(package private)  int iConnectionIncrement
          "jdbc.pooledconnectionincrement" parameter value
(package private)  int iInitialConnections
          "jdbc.initialconnectionpoolsize" parameter value
(package private)  String sVirtualRootDirectory
          "directory.virtualroot" parameter value
 
Constructor Summary
PropertyFileParameters(FileListerXMLHandler xmlHandler)
          Overloaded constructor which avoids the parsing of the file.
PropertyFileParameters(String sPropertyFileDir)
          Constructor parses the given config XML file and verifies the entries.
 
Method Summary
 int getConnectionIncrement(boolean bWithReloadCheck)
          Returns the amount of connections that shall be established by the connection pool if the initial pool is not big enough (on heavy load).
 String getConnectionString()
          Returns the name of the connection string to be used by the JDBC driver used by FileLister.
 String getDriverClassName()
          Returns the class name of the JDBC driver to be used by FileLister.
 int getIndexAging(boolean bWithReloadCheck)
          Returns the amount of seconds that the engine shall wait until a directory search is (physically) performed again.
 int getInitialConnections(boolean bWithReloadCheck)
          Returns the amount of connections that shall be established by the connection pool on initialization.
 String getJDBCTableName()
          Returns the name of the table within the database where the index shall be written into / read from.
 String getLinkPrefix()
          Returns the prefix that shall be set before the path of each entry, so that the entry can be viewed/downloaded from the web GUI (e.g.
 int getMaxFileListerObjects(boolean bWithReloadCheck)
          Returns how many FileListerEntry objects shall be kept at most in the memory.
 LinkedList getNoGoAreas(boolean bWithReloadCheck)
          Returns a list of the tokenized entries of the no-go-areas, each defining a path on the file system which must not be indexed.
 String getPassword()
          Returns the password of the database (used to build a connection).
 String getRegExpHelpLink()
          Returns the link that shall be used for explanation of the regexp functionality in the "definesearch" site.
 SQLQueryBuilder getSQLQueryBuilder()
          Returns the concrete implementation class of SQLQueryBuilder, adapted for the database server to be used by the FileLister application.
 String getUserName()
          Returns the user name of the database (used to build a connection).
 String getVirtualRootDirectory(boolean bWithReloadCheck)
          Returns the virtual root setting of the property file; this value may equal the "", if not set.
 String getZipCreationDirectory(boolean bWithReloadCheck)
          Returns the path of the directory where the zip files shall be generated in (used only if it's allowed to zip).
 int getZipPackageStrength(boolean bWithReloadCheck)
          Returns the zip package strength, the value which indicates how hard the generated zip files shall be minimized (in size).
 boolean isAllowedToZip()
          Returns whether it's allowed to download web GUI entries in a zip file created by FileLister or not.
 boolean isShowingAbsolutePaths()
          Returns whether the file listing output shall contain absolute or virtual paths within the link URL's.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sVirtualRootDirectory

String sVirtualRootDirectory
"directory.virtualroot" parameter value


iInitialConnections

int iInitialConnections
"jdbc.initialconnectionpoolsize" parameter value


iConnectionIncrement

int iConnectionIncrement
"jdbc.pooledconnectionincrement" parameter value

Constructor Detail

PropertyFileParameters

public PropertyFileParameters(String sPropertyFileDir)
                       throws FileListerException,
                              IOException
Constructor parses the given config XML file and verifies the entries. If an exception other than an IOException occurs, it's wrapped within a FileListerException and thrown.

Parameters:
sPropertyFileDir - the directory where the property file is stored
Throws:
FileListerException - each possible exception that may occur during the parsing-of-the-property-file process
IOException - if the property file can't be accessed somehow

PropertyFileParameters

public PropertyFileParameters(FileListerXMLHandler xmlHandler)
                       throws FileListerException
Overloaded constructor which avoids the parsing of the file. Instead of this, a fully configured reader is passed and the settings are read/validated from of the given instance.

Parameters:
xmlHandler - the previously instantiated config reader
Throws:
FileListerException - if there is an inacceptable config setting
Method Detail

getVirtualRootDirectory

public String getVirtualRootDirectory(boolean bWithReloadCheck)
Returns the virtual root setting of the property file; this value may equal the "", if not set.

Parameters:
bWithReloadCheck - whether to check for a xml file reload or not
Returns:
the "directory.virtualroot" parameter value

isShowingAbsolutePaths

public boolean isShowingAbsolutePaths()
Returns whether the file listing output shall contain absolute or virtual paths within the link URL's.

Returns:
the "directory.showabsolutepaths" parameter value (true is default)

getIndexAging

public int getIndexAging(boolean bWithReloadCheck)
Returns the amount of seconds that the engine shall wait until a directory search is (physically) performed again.

Parameters:
bWithReloadCheck - whether to check for a xml file reload or not
Returns:
the "index.aging" parameter value

getMaxFileListerObjects

public int getMaxFileListerObjects(boolean bWithReloadCheck)
Returns how many FileListerEntry objects shall be kept at most in the memory.

Parameters:
bWithReloadCheck - whether to check for a xml file reload or not
Returns:
the "system.maxfilelisterobjects" parameter value

getNoGoAreas

public LinkedList getNoGoAreas(boolean bWithReloadCheck)
Returns a list of the tokenized entries of the no-go-areas, each defining a path on the file system which must not be indexed.

Parameters:
bWithReloadCheck - whether to check for a xml file reload or not
Returns:
the "directory.nogoarea" parameter values, tokenized and stored in a LinkedList

getDriverClassName

public String getDriverClassName()
Returns the class name of the JDBC driver to be used by FileLister.

Returns:
the "jdbc.driverclass" parameter value

getConnectionString

public String getConnectionString()
Returns the name of the connection string to be used by the JDBC driver used by FileLister.

Returns:
the "jdbc.connectionstring" parameter value

getUserName

public String getUserName()
Returns the user name of the database (used to build a connection).

Returns:
the "jdbc.username" parameter value

getPassword

public String getPassword()
Returns the password of the database (used to build a connection).

Returns:
the "jdbc.password" parameter value

getInitialConnections

public int getInitialConnections(boolean bWithReloadCheck)
Returns the amount of connections that shall be established by the connection pool on initialization.

Parameters:
bWithReloadCheck - whether to check for a xml file reload or not
Returns:
the "jdbc.initialconnectionpoolsize" parameter value

getConnectionIncrement

public int getConnectionIncrement(boolean bWithReloadCheck)
Returns the amount of connections that shall be established by the connection pool if the initial pool is not big enough (on heavy load).

Parameters:
bWithReloadCheck - whether to check for a xml file reload or not
Returns:
the "jdbc.pooledconnectionincrement" parameter value

getJDBCTableName

public String getJDBCTableName()
Returns the name of the table within the database where the index shall be written into / read from.

Returns:
the "jdbc.tablename" parameter value

getSQLQueryBuilder

public SQLQueryBuilder getSQLQueryBuilder()
Returns the concrete implementation class of SQLQueryBuilder, adapted for the database server to be used by the FileLister application.

Returns:
"jdbc.querybuilderclass" parameter value, loaded into a subclass of SQLQueryBuilder and therefore verified

getLinkPrefix

public String getLinkPrefix()
Returns the prefix that shall be set before the path of each entry, so that the entry can be viewed/downloaded from the web GUI (e.g. "ftp://localhost").

Returns:
the "link.prefix" parameter value

getRegExpHelpLink

public String getRegExpHelpLink()
Returns the link that shall be used for explanation of the regexp functionality in the "definesearch" site.

Returns:
the "link.regexphelp" parameter value

isAllowedToZip

public boolean isAllowedToZip()
Returns whether it's allowed to download web GUI entries in a zip file created by FileLister or not.

Returns:
the "zip.isallowedtozip" parameter value (false is default)

getZipCreationDirectory

public String getZipCreationDirectory(boolean bWithReloadCheck)
Returns the path of the directory where the zip files shall be generated in (used only if it's allowed to zip).

Parameters:
bWithReloadCheck - whether to check for a xml file reload or not
Returns:
the "zip.creationdirectory" parameter value

getZipPackageStrength

public int getZipPackageStrength(boolean bWithReloadCheck)
Returns the zip package strength, the value which indicates how hard the generated zip files shall be minimized (in size).

Parameters:
bWithReloadCheck - whether to check for a xml file reload or not
Returns:
the "zip.packagestrength" parameter value (4 is default)