org.openmobileis.common.util
Interface PropertiesService

All Known Implementing Classes:
PropertiesManager

public interface PropertiesService

Author:
phil

Method Summary
 void addPropertiesFile(java.lang.String filename)
          load a property file inside the classpath.
 void addPropertiesFileFromFilePath(java.lang.String filename)
          load a property file from the file system If not found throw IOException
 void addProperty(java.lang.String key, java.lang.String value)
          add the specified key,value to the manager properties
 java.util.Properties getProperties()
          return all the loaded properties
 java.util.Properties getProperties(java.lang.String prop_file)
          read the property file inside the classpath.
 java.util.Properties getPropertiesFromPath(java.lang.String prop_file)
          read the property file from the file system Does not load it
 java.lang.String getProperty(java.lang.String key)
          return the property with specified key from loaded properties.
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          return the property with specified key from loaded properties.
 void removeAllProperties()
          remove all resource manager properties
 

Method Detail

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)
return the property with specified key from loaded properties. return default value if not found.

Parameters:
key - : the property key to get
defaultValue - : default value if key is not found
Returns:
the property with specified key or default value if not found.

getProperty

public java.lang.String getProperty(java.lang.String key)
return the property with specified key from loaded properties. return null if not found.

Parameters:
key - : the property key to get
Returns:
the property with specified key or null if not found.

addProperty

public void addProperty(java.lang.String key,
                        java.lang.String value)
add the specified key,value to the manager properties

Parameters:
key - : the property key
value - : value of the property

removeAllProperties

public void removeAllProperties()
remove all resource manager properties


addPropertiesFile

public void addPropertiesFile(java.lang.String filename)
                       throws java.io.IOException
load a property file inside the classpath. if the path is /org/openmobileis/file.properties First look in the classpath for /properties/org/openmobileis/file.properties then in /org/openmobileis/file.properties. If not found throw IOException

Parameters:
filename - : properties file name.
Throws:
java.io.IOException - : throws if the file is not found

addPropertiesFileFromFilePath

public void addPropertiesFileFromFilePath(java.lang.String filename)
                                   throws java.io.IOException
load a property file from the file system If not found throw IOException

Parameters:
filename - : properties file name.
Throws:
java.io.IOException - : throws if the file is not found

getProperties

public java.util.Properties getProperties(java.lang.String prop_file)
                                   throws java.io.IOException
read the property file inside the classpath. Does not load it if the path is /org/openmobileis/file.properties First looks in the classpath for /properties/org/openmobileis/file.properties then for /org/openmobileis/file.properties. If not found throw IOException

Throws:
java.io.IOException - : throws if the file is not found

getPropertiesFromPath

public java.util.Properties getPropertiesFromPath(java.lang.String prop_file)
                                           throws java.io.IOException
read the property file from the file system Does not load it

Throws:
java.io.IOException - : throws if the file is not found

getProperties

public java.util.Properties getProperties()
return all the loaded properties

Returns:
the loaded properties


Copyright 2006 OpenMobileIS. All Rights Reserved.