org.universAAL.middleware.container.osgi.util
Class BundleConfigHome

Package class diagram package BundleConfigHome
java.lang.Object
  extended by org.universAAL.middleware.container.utils.ModuleConfigHome
      extended by org.universAAL.middleware.container.osgi.util.BundleConfigHome
Direct Known Subclasses:
Messages

public class BundleConfigHome
extends ModuleConfigHome

The base class for configuration files in universAAL. All configuration files are contained in the root directory of the universAAL runtime (rundir). The configuration files of a bundle are contained in a subdirectory with the name of that bundle (Best Practice).

Author:
Carsten Stockloew

Field Summary
static String uAAL_CONF_ROOT_DIR
          The root directory of the runtime configuration.
 
Fields inherited from class org.universAAL.middleware.container.utils.ModuleConfigHome
confHome
 
Constructor Summary
BundleConfigHome(String id)
          Constructor the create a new object for accessing configuration files.
 
Method Summary
 InputStream getConfFileAsStream(File f)
          Get an InputStream for the given File.
 File getPropFile(String nameWithoutExtension)
          Get a File of the configuration file.
 
Methods inherited from class org.universAAL.middleware.container.utils.ModuleConfigHome
getAbsolutePath, getConfFileAsOutputStream, getConfFileAsStream, listFiles
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uAAL_CONF_ROOT_DIR

public static final String uAAL_CONF_ROOT_DIR
The root directory of the runtime configuration.

See Also:
Constant Field Values
Constructor Detail

BundleConfigHome

public BundleConfigHome(String id)
Constructor the create a new object for accessing configuration files. The actual file name consists of the root directory of the universAAL runtime, the given ID (which is by Best Practice the bundle name), and a file name which is given to the methods ModuleConfigHome.getConfFileAsStream(String) or ModuleConfigHome.getConfFileAsOutputStream(String).

Parameters:
id - The ID of this module.
Method Detail

getConfFileAsStream

public InputStream getConfFileAsStream(File f)
                                throws IOException
Get an InputStream for the given File.

Parameters:
f - The file.
Returns:
An InputStream for the file.
Throws:
IOException

getPropFile

public File getPropFile(String nameWithoutExtension)
Get a File of the configuration file. The file name is created by the home directory (as created in the constructor), the parameter given to this method and the suffix ".properties".

Parameters:
nameWithoutExtension -
Returns:


Copyright © 2014 universAAL Consortium. All Rights Reserved.