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 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(File file)
          Convenience constructor.
PropertiesPropertiesAdapter(InputStream inputStream)
          Constructor.
PropertiesPropertiesAdapter(URL url)
          Convenience constructor.
 
Method Summary
 Map<String,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(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(File file)
                            throws FileNotFoundException
Convenience constructor.

Parameters:
file - file containing properties
Throws:
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(URL url)
                            throws IOException
Convenience constructor.

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

getProperties

public Map<String,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 © 2006-2012 OPS4J - Open Participation Software for Java. All Rights Reserved.