Class PropertiesLoader
- java.lang.Object
-
- org.apache.karaf.util.config.PropertiesLoader
-
public class PropertiesLoader extends Object
-
-
Constructor Summary
Constructors Constructor Description PropertiesLoader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcopySystemProperties(org.apache.felix.utils.properties.Properties configProps)static org.apache.felix.utils.properties.PropertiesloadConfigProperties(File file)Loads the configuration properties in the configuration property file associated with the framework installation; these properties are accessible to the framework and to bundles and are intended for configuration purposes.static org.apache.felix.utils.properties.PropertiesloadPropertiesFile(URL configPropURL, boolean failIfNotFound)static org.apache.felix.utils.properties.PropertiesloadPropertiesOrFail(File configFile)static voidloadSystemProperties(File file)Loads the properties in the system property file associated with the framework installation intoSystem.setProperty().
-
-
-
Method Detail
-
loadConfigProperties
public static org.apache.felix.utils.properties.Properties loadConfigProperties(File file) throws Exception
Loads the configuration properties in the configuration property file associated with the framework installation; these properties are accessible to the framework and to bundles and are intended for configuration purposes. By default, the configuration property file is located in the
conf/directory of the Felix installation directory and is called "config.properties". The installation directory of Felix is assumed to be the parent directory of thefelix.jarfile as found on the system class path property. The precise file from which to load configuration properties can be set by initializing the "felix.config.properties" system property to an arbitrary URL.- Parameters:
file- the config file where to load the properties.- Returns:
- A
Propertiesinstance ornullif there was an error. - Throws:
Exception- if something wrong occurs.
-
loadSystemProperties
public static void loadSystemProperties(File file) throws IOException
Loads the properties in the system property file associated with the framework installation into
System.setProperty(). These properties are not directly used by the framework in anyway. By default, the system property file is located in theconf/directory of the Felix installation directory and is called "system.properties". The installation directory of Felix is assumed to be the parent directory of thefelix.jarfile as found on the system class path property. The precise file from which to load system properties can be set by initializing the "felix.system.properties" system property to an arbitrary URL.- Parameters:
file- the Karaf base folder.- Throws:
IOException- if the system file can't be loaded.
-
copySystemProperties
public static void copySystemProperties(org.apache.felix.utils.properties.Properties configProps)
-
loadPropertiesOrFail
public static org.apache.felix.utils.properties.Properties loadPropertiesOrFail(File configFile)
-
-