Class PepperStarterConfiguration

  • All Implemented Interfaces:
    Serializable, Cloneable, Map<Object,​Object>

    public class PepperStarterConfiguration
    extends org.corpus_tools.pepper.common.PepperConfiguration
    This class represents all properties to customize Pepper. This class is derived from the general class Properties and provides some shortcuts to access specific pepper properties. By default the properties are loaded from folder FILE_PEPPER_CONF. If the file FILE_PEPPER_TEST_PROP exists, this one will be taken, otherwise the system tries to load file FILE_PEPPER_PROP. This behavior can be changed by explicitly passing a properties file.
    To initialize the configuration, if no File or Properties are passed via the constructor, please call method load() or one of the other load methods.
    1. You can call the simple constructor #PepperProperties() having no parameters. This constructor will make use of the pepper home path mechanism and assumes a file named "pepper.properties" in the pepper home path
    This class uses a location called pepper home path, where it assumes all resources necessary to run Pepper. If no customization for these resources is given, default values are assumed. The pepper home path if not explicitly given is detected in the following order:
    1. check environment variable "PEPPER_HOME"
    2. check system property variable "PEPPER_HOME"
    3. set user.dir as pepper home
    Author:
    Florian Zipser
    See Also:
    Serialized Form
    • Field Detail

      • ENV_PEPPER_HOME

        public static final String ENV_PEPPER_HOME
        Name of the environment variable specifying the pepper home path.
        See Also:
        Constant Field Values
      • PROP_PEPPER_HOME

        public static final String PROP_PEPPER_HOME
        Name of the system property specifying the pepper home path.
        See Also:
        Constant Field Values
      • PROP_CONSOLE_WIDTH

        public static final String PROP_CONSOLE_WIDTH
        Name of property to determine the width of outout console. The width could be either 120 or 80.
        See Also:
        Constant Field Values
      • KEY_PEPPER_HOME

        public static final String KEY_PEPPER_HOME
        A key for using the a variable for the pepper home path inside of property files.
        See Also:
        Constant Field Values
      • FILE_PEPPER_PROP

        public static final String FILE_PEPPER_PROP
        Name of the file containing all pepper properties.
        See Also:
        Constant Field Values
      • FILE_PEPPER_TEST_PROP

        public static final String FILE_PEPPER_TEST_PROP
        Name of the file containing all pepper properties.
        See Also:
        Constant Field Values
      • FILE_PEPPER_CONF

        public static final String FILE_PEPPER_CONF
        Folder, where to find all configuration files for Pepper
        See Also:
        Constant Field Values
      • PROP_PLUGIN_PATH

        public static final String PROP_PLUGIN_PATH
        name of the property of where to find the plugin path
        See Also:
        Constant Field Values
      • PROP_DROPIN_PATHS

        public static final String PROP_DROPIN_PATHS
        name of the property of where to find the dropin paths (comma seperated)
        See Also:
        Constant Field Values
      • PROP_OSGI_PROFILE

        public static final String PROP_OSGI_PROFILE
        name of the property of the location of the osgi profile
        See Also:
        Constant Field Values
      • PROP_OSGI_SHAREDPACKAGES

        public static final String PROP_OSGI_SHAREDPACKAGES
        name of the property of the location of the osgi profile
        See Also:
        Constant Field Values
    • Constructor Detail

      • PepperStarterConfiguration

        public PepperStarterConfiguration()
        Creates a PepperStarterConfiguration object, without setting any property.
      • PepperStarterConfiguration

        public PepperStarterConfiguration​(File propertiesFile)
        Creates a PepperStarterConfiguration object, using the given file to read the properties to be load into the new created object.
        Parameters:
        propertiesFile - file containing the pepper properties
    • Method Detail

      • findPepperHome

        public static File findPepperHome()
        Extracts the home path of pepper and returns it. The home path is searched in following order:
        1. check environment variable "PEPPER_HOME"
        2. check system property variable "PEPPER_HOME"
        3. set user.dir as pepper home
        Returns:
        path of pepper home
      • load

        public void load()
        For test purposes, properties are load from the file FILE_PEPPER_TEST_PROP, which is assumed to be in the FILE_PEPPER_CONF folder in the pepper home path. If this file does not exists, the properties are tried to load from the file FILE_PEPPER_PROP in the same folder.
      • load

        public void load​(File propertiesFile)
        Loads pepper properties from given file.
        Overrides:
        load in class org.corpus_tools.pepper.common.PepperConfiguration
        Parameters:
        propertiesFile -
      • getPlugInPath

        public String getPlugInPath()
        Returns the plugIn path, where to find the OSGi bundles.
        Returns:
        plugIn path
      • getDropInPaths

        public List<String> getDropInPaths()
        Returns the dropin paths, where to find the OSGi bundles.
        Returns:
        plugIn path
      • getPepperEMail

        public String getPepperEMail()
        Returns the eMail address of SaltNPepper.
        Returns:
        plugIn path
      • getPepperHomepage

        public String getPepperHomepage()
        Returns the homepage address of SaltNPepper.
        Returns:
        plugIn path
      • getOSGiProfileFile

        public File getOSGiProfileFile()
        Returns the path of the OSGi profile file
        Returns:
        plugIn path
      • getConsoleWidth

        public int getConsoleWidth()
        Returns the width of the output console. The width could be either 120 or 80.