Package org.nuxeo.common
Class Environment
java.lang.Object
org.nuxeo.common.Environment
- Author:
- Bogdan Stefanescu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String[]static final Stringstatic final StringThe application layout (optional): directory containing nuxeo runtime osgi bundles.protected Filestatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Filestatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Stringprotected Stringprotected final Fileprotected Stringprotected Stringprotected booleanstatic final Stringstatic final Stringstatic final StringConstants that identifies possible hosts for the framework.protected Filestatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected final Propertiesstatic final Stringprotected Filestatic final Stringprotected File -
Constructor Summary
ConstructorsConstructorDescriptionEnvironment(File home) Call to that constructor should be followed by a call toinit().Environment(File home, Properties properties) Call to that constructor should be followed by a call toinit(). -
Method Summary
Modifier and TypeMethodDescriptionString[]getData()static Environmentstatic EnvironmentgetDefault(Properties systemProperties) protected voidgetHome()getLog()getProperty(String key) getProperty(String key, String defaultValue) This method always returns the server home (orgetHome()ifNUXEO_HOME_DIRis not set).getTemp()getWeb()voidinit()Initialization with System properties to avoid issues due to home set with runtime home instead of server home.booleanbooleanisJBoss()booleanisJetty()booleanisTomcat()voidloadProperties(Properties props) voidsetCommandLineArguments(String[] args) voidvoidResolve the path againstruntimeHomeif not absolute.voidsetConfigurationProvider(Iterable<URL> configProvider) voidvoidResolve the path againstruntimeHomeif not absolute.static voidsetDefault(Environment env) voidsetHostApplicationName(String name) voidsetHostApplicationVersion(String version) voidsetIsApplicationServer(boolean isAppServer) voidvoidResolve the path againstserverHomeif not absolute.voidAdd a file path as a propertyvoidAdd a file path as a propertyvoidAdd a file path as a propertyvoidAdd a file path as a propertyvoidsetProperty(String key, String value) If setting a path property, consider usingsetPath(String, String)voidsetRuntimeHome(File runtimeHome) voidsetServerHome(File serverHome) voidvoidResolve the path againstserverHomeif not absolute.voidvoidResolve the path againstruntimeHomeif not absolute.toString()
-
Field Details
-
JBOSS_HOST
Constants that identifies possible hosts for the framework.- See Also:
-
NXSERVER_HOST
- See Also:
-
TOMCAT_HOST
- See Also:
-
NUXEO_HOME_DIR
- See Also:
-
NUXEO_HOME
- Since:
- 5.6
- See Also:
-
NUXEO_RUNTIME_HOME
- Since:
- 5.4.2
- See Also:
-
NUXEO_DATA_DIR
- See Also:
-
DEFAULT_DATA_DIR
- Since:
- 5.9.4
- See Also:
-
NUXEO_LOG_DIR
- See Also:
-
DEFAULT_LOG_DIR
- Since:
- 5.9.4
- See Also:
-
NUXEO_PID_DIR
- See Also:
-
NUXEO_TMP_DIR
- See Also:
-
DEFAULT_TMP_DIR
- Since:
- 5.9.4
- See Also:
-
NUXEO_CONFIG_DIR
- See Also:
-
DEFAULT_CONFIG_DIR
- Since:
- 5.9.4
- See Also:
-
NUXEO_WEB_DIR
- See Also:
-
DEFAULT_WEB_DIR
- Since:
- 5.9.4
- See Also:
-
NUXEO_MP_DIR
- Since:
- 5.9.4
- See Also:
-
DEFAULT_MP_DIR
- Since:
- 5.9.4
- See Also:
-
NUXEO_CONTEXT_PATH
- Since:
- 5.6
- See Also:
-
BUNDLES_DIR
The application layout (optional): directory containing nuxeo runtime osgi bundles.- See Also:
-
BUNDLES
- See Also:
-
home
-
data
-
log
-
config
-
web
-
temp
-
properties
-
args
-
isAppServer
protected boolean isAppServer -
hostAppName
-
hostAppVersion
-
configProvider
-
distributionVersion
-
distributionDate
-
SERVER_STATUS_KEY
- See Also:
-
DISTRIBUTION_NAME
- See Also:
-
DISTRIBUTION_VERSION
- See Also:
-
DISTRIBUTION_SERVER
- Since:
- 7.10
- See Also:
-
DISTRIBUTION_DATE
- Since:
- 7.10
- See Also:
-
DISTRIBUTION_PACKAGE
- Since:
- 7.10
- See Also:
-
DISTRIBUTION_HOTFIX
- Since:
- 11.5
- See Also:
-
DISTRIBUTION_PROPERTY_FILE
- Since:
- 11.5
- See Also:
-
PRODUCT_NAME
- Since:
- 7.10
- See Also:
-
PRODUCT_VERSION
- Since:
- 7.10
- See Also:
-
NUXEO_HTTP_PROXY_HOST
- Since:
- 6.0
- See Also:
-
NUXEO_HTTP_PROXY_PORT
- Since:
- 6.0
- See Also:
-
NUXEO_HTTP_PROXY_LOGIN
- Since:
- 6.0
- See Also:
-
NUXEO_HTTP_PROXY_PASSWORD
- Since:
- 6.0
- See Also:
-
CRYPT_ALGO
- Since:
- 7.4
- See Also:
-
CRYPT_KEY
- Since:
- 7.4
- See Also:
-
CRYPT_KEYALIAS
- Since:
- 7.4
- See Also:
-
CRYPT_KEYSTORE_PATH
- Since:
- 7.4
- See Also:
-
CRYPT_KEYSTORE_PASS
- Since:
- 7.4
- See Also:
-
JAVA_DEFAULT_KEYSTORE
- Since:
- 7.4
- See Also:
-
JAVA_DEFAULT_KEYSTORE_PASS
- Since:
- 7.4
- See Also:
-
-
Constructor Details
-
Environment
Call to that constructor should be followed by a call toinit(). Depending on the available System properties, you may want to also callloadProperties(Properties)orsetServerHome(File)methods beforeinit(); here is the recommended order:Environment env = new Environment(home); Environment.setDefault(env); env.loadProperties(properties); env.setServerHome(home); env.init();
- Parameters:
home- Root path used for most defaults. It is recommended to make it match the server home rather than the runtime home.- See Also:
-
Environment
Call to that constructor should be followed by a call toinit(). Depending on the available System properties, you may want to also callsetServerHome(File)method beforeinit(); here is the recommended order:Environment env = new Environment(home, properties); Environment.setDefault(env); env.setServerHome(home); env.init();
- Parameters:
home- Root path used for most defaults. It is recommended to make it match the server home rather than the runtime home.properties- Source properties for initialization. It is used as anHashtable: ie only the custom values are read, the properties default values are ignored if any.- See Also:
-
-
Method Details
-
setDefault
-
getDefault
-
getDefault
- Since:
- 11.5
-
getHome
-
isApplicationServer
public boolean isApplicationServer() -
setIsApplicationServer
public void setIsApplicationServer(boolean isAppServer) -
getHostApplicationName
-
getHostApplicationVersion
-
setHostApplicationName
-
setHostApplicationVersion
-
getTemp
-
setTemp
Resolve the path againstserverHomeif not absolute.- Since:
- 8.1
-
setTemp
-
getConfig
-
setConfig
Resolve the path againstruntimeHomeif not absolute.- Since:
- 8.1
-
setConfig
-
getLog
-
setLog
Resolve the path againstserverHomeif not absolute.- Since:
- 8.1
-
setLog
-
getData
-
setData
Resolve the path againstruntimeHomeif not absolute.- Since:
- 8.1
-
setData
-
getWeb
-
setWeb
Resolve the path againstruntimeHomeif not absolute.- Since:
- 8.1
-
setWeb
-
getRuntimeHome
- Since:
- 5.4.2
-
setRuntimeHome
- Since:
- 5.4.2
-
getCommandLineArguments
-
setCommandLineArguments
-
getProperty
-
getProperty
-
setProperty
If setting a path property, consider usingsetPath(String, String) -
getProperties
-
loadProperties
-
isJBoss
public boolean isJBoss() -
isJetty
public boolean isJetty() -
isTomcat
public boolean isTomcat() -
init
public void init()Initialization with System properties to avoid issues due to home set with runtime home instead of server home. IfNUXEO_HOMESystem property is not set, or if you want to set a custom server home, then you should callsetServerHome(File)before.- Since:
- 5.4.1
-
getServerHome
This method always returns the server home (orgetHome()ifNUXEO_HOME_DIRis not set).- Returns:
- Server home
- Since:
- 5.4.2
-
setServerHome
- Since:
- 5.4.2
-
setConfigurationProvider
-
getConfigurationProvider
-
toString
-
setPath
Add a file path as a property- Parameters:
key- Property keyvalue- Property value: an absolute or relative filebaseDir- The directory against which the file will be resolved if not absolute- Since:
- 8.1
- See Also:
-
setPath
Add a file path as a property- Parameters:
key- Property keyvalue- Property value: an absolute or relative file pathbaseDir- The directory against which the file will be resolved if not absolute- Since:
- 8.1
- See Also:
-
setPath
Add a file path as a property- Parameters:
key- Property keyvalue- Property value: an absolute or relative file; if relative, it will be resolved againsthome- Since:
- 8.1
- See Also:
-
setPath
Add a file path as a property- Parameters:
key- Property keyvalue- Property value: an absolute or relative file path; if relative, it will be resolved againsthome- Since:
- 8.1
- See Also:
-
getPath
- Returns:
- the file which path is associated with the given key. The file is guaranteed to be absolute if it has
been set with
setPath(String, File) - Since:
- 8.1
-
getPath
- Parameters:
key- the property keydefaultValue- the default path, absolute or relative to server home- Returns:
- the file which path is associated with the given key. The file is guaranteed to be absolute if it has
been set with
setPath(String, File) - Since:
- 8.1
-
getDistributionVersion
- Returns:
- the version of the Nuxeo distribution
- Since:
- 11.5
-
getDistributionDate
- Returns:
- the build date of the Nuxeo distribution
- Since:
- 11.5
-
getDistributionInfo
protected void getDistributionInfo()
-