org.jlogger.util
Class GlobalProperties

java.lang.Object
  |
  +--org.jlogger.util.GlobalProperties

public class GlobalProperties
extends java.lang.Object

Title: JLogger

Description: Java Based Logging Utility

Copyright: Copyright (c) 2002

Company: GeraSunil.com

Version:
1.0
Author:
Sunil K. Gera

Constructor Summary
GlobalProperties(java.io.InputStream is)
          Con with InputStream as parameter
GlobalProperties(java.lang.String fileName)
          Con with parameter File name as String **Note: Not supported now
 
Method Summary
static java.util.Properties getProperties()
          getProperties - returns the Properties obj
static java.lang.String getProperty(java.lang.String key)
          getProperty - Returns the property value for the given key
static java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          getProperty - returns the property value for the key&default value combination
static void list(java.io.PrintStream out)
          list - Lists all the properties from file
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobalProperties

public GlobalProperties(java.lang.String fileName)
                 throws java.lang.Exception
Con with parameter File name as String **Note: Not supported now
Parameters:
fileName - String
Throws:
java.lang.Exception - on load fail for properties

GlobalProperties

public GlobalProperties(java.io.InputStream is)
                 throws java.lang.Exception
Con with InputStream as parameter
Parameters:
is - InputStream
Throws:
java.lang.Exception - on load fail for properties
Method Detail

getProperty

public static java.lang.String getProperty(java.lang.String key)
                                    throws java.lang.Exception
getProperty - Returns the property value for the given key
Parameters:
key - String
Returns:
String value of the property
Throws:
java.lang.Exception - on null values

getProperty

public static java.lang.String getProperty(java.lang.String key,
                                           java.lang.String defaultValue)
                                    throws java.lang.Exception
getProperty - returns the property value for the key&default value combination
Parameters:
key - String
defaultValue - String
Returns:
String property value for the given key&default value combination
Throws:
java.lang.Exception -  

list

public static void list(java.io.PrintStream out)
list - Lists all the properties from file
Parameters:
out - PrintStream

getProperties

public static java.util.Properties getProperties()
getProperties - returns the Properties obj
Returns:
Properties obj