Class PropertiesLoader


  • public class PropertiesLoader
    extends Object
    • Constructor Detail

      • PropertiesLoader

        public PropertiesLoader()
    • 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 the felix.jar file 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 Properties instance or null if 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 the conf/ directory of the Felix installation directory and is called "system.properties". The installation directory of Felix is assumed to be the parent directory of the felix.jar file 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)
      • loadPropertiesFile

        public static org.apache.felix.utils.properties.Properties loadPropertiesFile​(URL configPropURL,
                                                                                      boolean failIfNotFound)
                                                                               throws Exception
        Throws:
        Exception