Class sun.server.misc.ExProperties
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.server.misc.ExProperties

java.lang.Object
   |
   +----java.util.Dictionary
           |
           +----java.util.Hashtable
                   |
                   +----java.util.Properties
                           |
                           +----sun.server.misc.ExProperties

public class ExProperties
extends Properties
Enhanced support for properties. This methods in this class should eventually be put back into java.util.Properties.

Constructor Index

 o ExProperties()
Creates an empty property list.
 o ExProperties(Properties)
Creates an empty property list with specified defaults.

Method Index

 o getProperty(String, boolean)
Returns the boolean value of a property.
 o getProperty(String, int)
Returns the integer value of a property.
 o getProperty(String, long)
Returns the long value of a property.
 o load(File)
Loads properties from the specified file.
 o load(InputStream)
 o load(String)
Loads properties from the specified file.
 o save(File, String)
Saves properties to the specified file.
 o save(OutputStream, String)
overrides the save() method in Properties to load server specific property files.
 o save(String, String)
Saves properties to the specified file.
 o setProperty(String, boolean)
Sets the boolean value of a property.
 o setProperty(String, int)
Sets the integer value of a property.
 o setProperty(String, long)
Sets the long value of a property.
 o setProperty(String, String)
Sets the value of a property.

Constructors

 o ExProperties
  public ExProperties()
Creates an empty property list.
 o ExProperties
  public ExProperties(Properties defaults)
Creates an empty property list with specified defaults.
Parameters:
defaults - the defaults

Methods

 o load
  public void load(String name) throws IOException
Loads properties from the specified file.
Parameters:
name - the file name
Throws: FileNotFoundException
if the file is not found
Throws: IOException
if an I/O error has occurred
 o load
  public void load(InputStream in) throws IOException
Overrides:
load in class Properties
 o load
  public void load(File file) throws IOException
Loads properties from the specified file.
Parameters:
file - the file object
Throws: FileNotFoundException
if the file is not found
Throws: IOException
if an I/O error has occurred
 o save
  public void save(String name,
                   String header) throws IOException
Saves properties to the specified file.
Parameters:
name - the file name
header - the header comment
Throws: IOException
if an I/O error has occurred
 o save
  public void save(OutputStream out,
                   String header)
overrides the save() method in Properties to load server specific property files.
Overrides:
save in class Properties
 o save
  public void save(File file,
                   String header) throws IOException
Saves properties to the specified file.
Parameters:
file - the file object
header - the header comment
Throws: IOException
if an I/O error has occurred
 o getProperty
  public int getProperty(String key,
                         int def) throws NumberFormatException
Returns the integer value of a property.
Parameters:
key - the property key
def - the default value to return if this property is not set
Throws: NumberFormatException
if the property is set but cannot be parsed as an integer
 o getProperty
  public long getProperty(String key,
                          long def) throws NumberFormatException
Returns the long value of a property.
Parameters:
key - the property key
def - the default value to return if this property is not set
Throws: NumberFormatException
if the property is set but cannot be parsed as a long
 o getProperty
  public boolean getProperty(String key,
                             boolean def)
Returns the boolean value of a property.
Parameters:
key - the property key
def - the default value to return if this property is not set
 o setProperty
  public void setProperty(String key,
                          String s)
Sets the value of a property.
Parameters:
key - the property key
s - the property value
 o setProperty
  public void setProperty(String key,
                          int i)
Sets the integer value of a property.
Parameters:
key - the property key
i - the integer value
 o setProperty
  public void setProperty(String key,
                          long l)
Sets the long value of a property.
Parameters:
key - the property key
l - the long value
 o setProperty
  public void setProperty(String key,
                          boolean b)
Sets the boolean value of a property.
Parameters:
key - the property key
b - the boolean value

All Packages  Class Hierarchy  This Package  Previous  Next  Index