org.ops4j.pax.configmanager.internal.handlers
Class PropertiesFileConfigurationHandler

java.lang.Object
  extended by org.ops4j.pax.configmanager.internal.handlers.PropertiesFileConfigurationHandler
All Implemented Interfaces:
IConfigurationFileHandler

public final class PropertiesFileConfigurationHandler
extends java.lang.Object
implements IConfigurationFileHandler

PropertiesConfigurationFileHandler handles configuration files with extension of .properties.

Author:
Edward Yakop, Makas Tzavellas

Constructor Summary
PropertiesFileConfigurationHandler()
           
 
Method Summary
 boolean canHandle(java.io.File file)
          Returns true if the specified file can be handled by this IConfigurationFileHandler.
 java.lang.String getServicePID(java.lang.String fileName)
          Returns the configuration name of the specified fileName.
 java.util.Properties handle(java.io.File file)
          Returns the properties after loading the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesFileConfigurationHandler

public PropertiesFileConfigurationHandler()
Method Detail

getServicePID

public final java.lang.String getServicePID(java.lang.String fileName)
Returns the configuration name of the specified fileName. The specified fileName must not have file path prefix. Returns null if the file name can not be handled by this handler.

Specified by:
getServicePID in interface IConfigurationFileHandler
Parameters:
fileName - The file name. This argument must not be null.
Returns:
Returns the configuration name given the fileName argument.

handle

public final java.util.Properties handle(java.io.File file)
                                  throws java.lang.IllegalArgumentException
Returns the properties after loading the specified file. Returns empty properties if the specified file does not have any configuration properties.

Specified by:
handle in interface IConfigurationFileHandler
Parameters:
file - The configuration file to be loaded. This argument must not be null.
Returns:
Returns the Properties of the specified file.
Throws:
java.lang.IllegalArgumentException - thrown if the specified file argument is null.
Since:
1.0.0

canHandle

public final boolean canHandle(java.io.File file)
                        throws java.lang.IllegalArgumentException
Returns true if the specified file can be handled by this IConfigurationFileHandler.

Specified by:
canHandle in interface IConfigurationFileHandler
Parameters:
file - The file to be handled. This argument must not be null.
Returns:
A boolean indicator whether this IConfigurationFileHandler able to handle file.
Throws:
java.lang.IllegalArgumentException - Thrown if the specified file argument is null.
Since:
1.0.6


Copyright © 2008. All Rights Reserved.