Package org.corpus_tools.pepper.cli
Class PepperStarterConfiguration
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<Object,Object>
-
- java.util.Properties
-
- org.corpus_tools.pepper.common.PepperConfiguration
-
- org.corpus_tools.pepper.cli.PepperStarterConfiguration
-
- All Implemented Interfaces:
Serializable,Cloneable,Map<Object,Object>
public class PepperStarterConfiguration extends org.corpus_tools.pepper.common.PepperConfigurationThis class represents all properties to customize Pepper. This class is derived from the general classPropertiesand provides some shortcuts to access specific pepper properties. By default the properties are loaded from folderFILE_PEPPER_CONF. If the fileFILE_PEPPER_TEST_PROPexists, this one will be taken, otherwise the system tries to load fileFILE_PEPPER_PROP. This behavior can be changed by explicitly passing a properties file.
To initialize the configuration, if noFileorPropertiesare passed via the constructor, please call methodload()or one of the other load methods.- 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
- check environment variable "PEPPER_HOME"
- check system property variable "PEPPER_HOME"
- set user.dir as pepper home
- Author:
- Florian Zipser
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringENV_PEPPER_HOMEName of the environment variable specifying the pepper home path.static StringFILE_PEPPER_CONFFolder, where to find all configuration files for Pepperstatic StringFILE_PEPPER_PROPName of the file containing all pepper properties.static StringFILE_PEPPER_TEST_PROPName of the file containing all pepper properties.static StringKEY_PEPPER_HOMEA key for using the a variable for the pepper home path inside of property files.static StringPROP_CONSOLE_WIDTHName of property to determine the width of outout console.static StringPROP_DROPIN_PATHSname of the property of where to find the dropin paths (comma seperated)static StringPROP_OSGI_PROFILEname of the property of the location of the osgi profilestatic StringPROP_OSGI_SHAREDPACKAGESname of the property of the location of the osgi profilestatic StringPROP_PEPPER_HOMEName of the system property specifying the pepper home path.static StringPROP_PLUGIN_PATHname of the property of where to find the plugin pathstatic StringPROP_PREFIXprefix of all properties-
Fields inherited from class org.corpus_tools.pepper.common.PepperConfiguration
ALL_PROP_NAMES, DEFAULT_WORKSPACE, EMAIL, ENV_PEPPER_MODULE_RESOURCES, FILE_CONF_FILE, FILE_CONF_FOLDER, FILE_CONF_TEST_FILE, FITNESS_FEATURE_DESC, HOMEPAGE, PROP_CALL_GC_AFTER_DOCUMENT, PROP_COMPUTE_PERFORMANCE, PROP_DETAILED_STATUS_REPORT, PROP_KEEP_TEMP_DOCS, PROP_MAX_AMOUNT_OF_SDOCUMENTS, PROP_MEMORY_POLICY, PROP_PEPPER_MODULE_RESOURCES, PROP_REPORT_INTERVAL, PROP_TEMP_FOLDER, PROP_WORKSPACE, SOURCES_RESOURCES
-
Fields inherited from class java.util.Properties
defaults
-
-
Constructor Summary
Constructors Constructor Description PepperStarterConfiguration()Creates aPepperStarterConfigurationobject, without setting any property.PepperStarterConfiguration(File propertiesFile)Creates aPepperStarterConfigurationobject, using the given file to read the properties to be load into the new created object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FilefindPepperHome()Extracts the home path of pepper and returns it.intgetConsoleWidth()Returns the width of the output console.List<String>getDropInPaths()Returns the dropin paths, where to find the OSGi bundles.FilegetOSGiProfileFile()Returns the path of the OSGi profile fileStringgetPepperEMail()Returns the eMail address of SaltNPepper.StringgetPepperHomepage()Returns the homepage address of SaltNPepper.StringgetPlugInPath()Returns the plugIn path, where to find the OSGi bundles.StringgetSharedPackages()Returns the content of propertyPROP_OSGI_SHAREDPACKAGES.voidload()For test purposes, properties are load from the fileFILE_PEPPER_TEST_PROP, which is assumed to be in theFILE_PEPPER_CONFfolder in the pepper home path.voidload(File propertiesFile)Loads pepper properties from given file.-
Methods inherited from class org.corpus_tools.pepper.common.PepperConfiguration
getConfFolder, getDetaialedStatReport, getGcAfterDocumentSleep, getKeepDocuments, getMaxAmountOfDocuments, getMemPolicy, getReportInterval, getTempPath, getWorkspace, load, setConfFolder
-
Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
-
-
-
Field Detail
-
PROP_PREFIX
public static final String PROP_PREFIX
prefix of all properties- See Also:
- Constant Field Values
-
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 aPepperStarterConfigurationobject, without setting any property.
-
PepperStarterConfiguration
public PepperStarterConfiguration(File propertiesFile)
Creates aPepperStarterConfigurationobject, 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:- check environment variable "PEPPER_HOME"
- check system property variable "PEPPER_HOME"
- set user.dir as pepper home
- Returns:
- path of pepper home
-
load
public void load()
For test purposes, properties are load from the fileFILE_PEPPER_TEST_PROP, which is assumed to be in theFILE_PEPPER_CONFfolder in the pepper home path. If this file does not exists, the properties are tried to load from the fileFILE_PEPPER_PROPin the same folder.
-
load
public void load(File propertiesFile)
Loads pepper properties from given file.- Overrides:
loadin classorg.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
-
getSharedPackages
public String getSharedPackages()
Returns the content of propertyPROP_OSGI_SHAREDPACKAGES.- Returns:
- plugIn path
-
getConsoleWidth
public int getConsoleWidth()
Returns the width of the output console. The width could be either 120 or 80.
-
-