Package org.nuxeo.common
Class Environment
java.lang.Object
org.nuxeo.common.Environment
- Author:
- Bogdan Stefanescu
-
Field Summary
Modifier and TypeFieldDescriptionprotected String[]
static final String
static final String
The application layout (optional): directory containing nuxeo runtime osgi bundles.protected File
static final String
static final String
static final String
static final String
static final String
protected File
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected String
protected String
protected final File
protected String
protected String
protected boolean
static final String
static final String
static final String
Constants that identifies possible hosts for the framework.protected File
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected final Properties
static final String
protected File
static final String
protected File
-
Constructor Summary
ConstructorDescriptionEnvironment
(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 Environment
static Environment
getDefault
(Properties systemProperties) protected void
getHome()
getLog()
getProperty
(String key) getProperty
(String key, String defaultValue) This method always returns the server home (orgetHome()
ifNUXEO_HOME_DIR
is not set).getTemp()
getWeb()
void
init()
Initialization with System properties to avoid issues due to home set with runtime home instead of server home.boolean
boolean
isJBoss()
boolean
isJetty()
boolean
isTomcat()
void
loadProperties
(Properties props) void
setCommandLineArguments
(String[] args) void
void
Resolve the path againstruntimeHome
if not absolute.void
setConfigurationProvider
(Iterable<URL> configProvider) void
void
Resolve the path againstruntimeHome
if not absolute.static void
setDefault
(Environment env) void
setHostApplicationName
(String name) void
setHostApplicationVersion
(String version) void
setIsApplicationServer
(boolean isAppServer) void
void
Resolve the path againstserverHome
if not absolute.void
Add a file path as a propertyvoid
Add a file path as a propertyvoid
Add a file path as a propertyvoid
Add a file path as a propertyvoid
setProperty
(String key, String value) If setting a path property, consider usingsetPath(String, String)
void
setRuntimeHome
(File runtimeHome) void
setServerHome
(File serverHome) void
void
Resolve the path againstserverHome
if not absolute.void
void
Resolve the path againstruntimeHome
if 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 againstserverHome
if not absolute.- Since:
- 8.1
-
setTemp
-
getConfig
-
setConfig
Resolve the path againstruntimeHome
if not absolute.- Since:
- 8.1
-
setConfig
-
getLog
-
setLog
Resolve the path againstserverHome
if not absolute.- Since:
- 8.1
-
setLog
-
getData
-
setData
Resolve the path againstruntimeHome
if not absolute.- Since:
- 8.1
-
setData
-
getWeb
-
setWeb
Resolve the path againstruntimeHome
if 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_HOME
System 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_DIR
is 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()
-