class: PropertyReader

public class: PropertyReader
Author: Peter Broszeit (initial creation)
Project: Phase: 1.0; Status: Proposed; Version: $Revision: 320 $ $LastChangedDate: 2007-11-14 18:1; Complexity: 1
Dates: Created: 16.07.2009 15:16:45; Modified: 16.07.2009 15:16:45;
Flags: Active: false; IsRoot: false; IsLeaf: false;
Extension Points:
UUID: {30D0792B-2F7A-4f9f-B079-0AE15289B357}
Helper class for reading properties from the global escidoc property file. This class tries to locate the properties in various ways. Once the properties file has been read it is cached. The following steps are executed to find a properties file:
<ul>
<li>First the location of the properties file is dertermined by looking for the system property
<code>pubman.properties.file</code>. This property can be used to set the path to the properties file that should be used. If this property is not set the default file path <code>pubman.properties</code> is used.
<li>Second step is to read the properties file: First we try to read the properties file from the local file system. If it cannot be found, it is searched in the classpath.
</ul>
 

Goto: Custom Properties, Fields, Methods

Appears in: framework

Custom Properties
 
PropertyReader Attributes
Attribute Details
private static const String
  DEFAULT_PROPERTY_FILE
Initial: "pubman.properties"
private static Properties
  properties
private static const String
  PROPERTY_FILE_KEY
Initial: "pubman.properties.file"
private static URL
  solution
 
PropertyReader Methods
Operation Details
private static
getInputStream(
   String filepath):InputStream
Sequential
Tags: throws=IOException
Notes: Retrieves the Inputstream of the given file path. First the resource is searched in the file system, if this fails it is searched using the classpath.
@return The inputstream of the given file path.
public static
getProperty(
   String key):String
Sequential
Tags: throws=IOException,URISyntaxException
Notes: Gets the value of a property for the given key from the system properties or the escidoc property file. It is always tried to get the requested property value from the system properties. This option gives the opportunity to set a specific property temporary using the system properties. If the requested property could not be obtained from the system properties the escidoc property file is accessed. (For details on access to the properties file see class description.)
@return The value of the property.
private static
loadProperties():void
Sequential
Tags: throws=IOException,URISyntaxException
Notes: Load the properties from the location defined by the system property <code>pubman.properties.file</code>. If this property is not set the default file path <code>pubman.properties</code> is used.