org.ops4j.pax.coin.adapter
Class PropertiesPropertiesAdapter

java.lang.Object
  extended by org.ops4j.pax.coin.adapter.PropertiesPropertiesAdapter
All Implemented Interfaces:
PropertiesAdapter

public class PropertiesPropertiesAdapter
extends java.lang.Object
implements PropertiesAdapter

Loads properties form an input stream of java Properties.

Since:
0.3.0, March 08, 2008
Author:
Alin Dreghiciu

Constructor Summary
PropertiesPropertiesAdapter(java.io.File file)
          Convenience constructor.
PropertiesPropertiesAdapter(java.io.InputStream inputStream)
          Constructor.
PropertiesPropertiesAdapter(java.net.URL url)
          Convenience constructor.
 
Method Summary
 java.util.Map<java.lang.String,java.lang.Object> getProperties()
          Loads properties form the input source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesPropertiesAdapter

public PropertiesPropertiesAdapter(java.io.InputStream inputStream)
Constructor.

Parameters:
inputStream - input stream to load properties from; cannot be null
Throws:
org.ops4j.lang.NullArgumentException - - If input stream is null

PropertiesPropertiesAdapter

public PropertiesPropertiesAdapter(java.io.File file)
                            throws java.io.FileNotFoundException
Convenience constructor.

Parameters:
file - file containing properties
Throws:
java.io.FileNotFoundException - - If file does not exist or an input stream cannot be generated out of it
org.ops4j.lang.NullArgumentException - - If file is null

PropertiesPropertiesAdapter

public PropertiesPropertiesAdapter(java.net.URL url)
                            throws java.io.IOException
Convenience constructor.

Parameters:
url - url targetting properties
Throws:
java.io.IOException - - If an input stream cannot be generated out of the url
org.ops4j.lang.NullArgumentException - - If url is null
Method Detail

getProperties

public java.util.Map<java.lang.String,java.lang.Object> getProperties()
Loads properties form the input source. If there is any IOException during using input stream it will return an empty map.

Specified by:
getProperties in interface PropertiesAdapter
Returns:
configuration properties
See Also:
PropertiesAdapter.getProperties()


Copyright © 2008. All Rights Reserved.