Class CmsSystemInfo
Contains information about:
- version and build number
- server name
- mail settings
- configuration paths
- default character encoding
- ...and more.
- Since:
- 6.0.0
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionclassWrapper class used to access build information.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringName of the config folder property provides as Java VM parameter -Dopencms.config=.static final StringRelative path to persistence.xml file.static final StringThe name of the opencms.properties file.static final StringThe name of the opencms.tld file.static final StringPath to the default "config" folder relative to the "WEB-INF" directory of the application.static final StringThe name of the module folder in the package path.static final StringPath to the "packages" folder relative to the "WEB-INF" directory of the application.static final StringPath to the "WEB-INF" folder relative to the directory of the application.static final StringThe VFS config files folder.static final StringThe folder to contain configuration file overrides.static final StringThe workplace UI servlet name.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturns an absolute path (to a directory or a file in the "real" file system) from a path relative to the web application folder of OpenCms.Returns an absolute path (to a directory or a file in the "real" file system) from a path relative to the "WEB-INF" folder of the OpenCms web application.Returns the map of additional build information that was contained in the version.properties file.getConfigFilePath(CmsObject cms, String configFile) Returns the path to a configuration file.Gets the path of the opencms config folder.Returns the absolute path to the "opencms.properties" configuration file (in the "real" file system).Returns the web application context path, e.g.Return the OpenCms default character encoding.Returns the default web application name (usually "ROOT").Gets the device selector.intReturns the maximum number of versions that are kept per file in the VFS version history.intReturns the number of versions in the VFS version history that should be kept after a resource is deleted.Returns the HTTP authentication settings.Returns the absolute path to the folder of the main OpenCms log file (in the "real" file system).Returns the filename of the log file (in the "real" file system).Returns the settings for the internal OpenCms email service.Returns the project in which time stamps for the content notification are read.intReturns the duration after which responsible resource owners will be notified about out-dated content (in days).Returns the OpenCms request context, e.g.Returns the absolute path to the "packages" folder (in the "real" file system).Returns the absolute path to the "persistence.xml" file (in the "real" file system).longReturns the time this OpenCms instance is running in milliseconds.Returns the OpenCms server name, e.g.Returns the servlet container specific settings.Returns the OpenCms servlet path, e.g.longReturns the time this OpenCms instance was started in milliseconds.Returns the context for static resources served from the class path, e.g.Returns the identifier "OpenCms/" plus the OpenCms version number.Returns the version ID of this OpenCms system.Returns the version number of this OpenCms system, for example9.5.0.Returns the OpenCms web application name, e.g.Returns the OpenCms web application folder in the servlet container.Returns the OpenCms web application "WEB-INF" directory path.Returns the OpenCms workplace request context, e.g.protected voidinit(CmsServletContainerSettings settings) Sets the OpenCms web application "WEB-INF" directory path (in the "real" file system).booleanReturns if the VFS version history is enabled.booleanReturn true if detail contents are restricted to detail pages from the same site.protected voidsetDefaultEncoding(String encoding) Sets the default encoding, called after the configuration files have been read.protected voidsetDeviceSelector(I_CmsJspDeviceSelector selector) Sets the device selector.protected voidsetHttpAuthenticationSettings(CmsHttpAuthenticationSettings httpAuthenticationSettings) Sets the HTTP authentication settings.protected voidsetMailSettings(CmsMailSettings mailSettings) Sets the settings for the internal OpenCms email service.voidsetNotificationProject(String notificationProject) Sets the project in which time stamps for the content notification are read.voidsetNotificationTime(int notificationTime) Sets the duration after which responsible resource owners will be notified about out-dated content (in days).protected voidsetRestrictDetailContents(boolean restrictDetailContents) Sets the value of the 'restrict detail contents' option.protected voidsetServerName(String serverName) Sets the server name.voidsetVersionHistorySettings(boolean historyEnabled, int historyVersions, int historyVersionsAfterDeletion) VFS version history settings are set here.
- 
Field Details- 
CONFIG_FOLDER_PROPERTYName of the config folder property provides as Java VM parameter -Dopencms.config=.- See Also:
 
- 
FILE_PERSISTENCERelative path to persistence.xml file.
- 
FILE_PROPERTIESThe name of the opencms.properties file.- See Also:
 
- 
FILE_TLDThe name of the opencms.tld file.- See Also:
 
- 
FOLDER_CONFIG_DEFAULTPath to the default "config" folder relative to the "WEB-INF" directory of the application.
- 
FOLDER_MODULESThe name of the module folder in the package path.
- 
FOLDER_PACKAGESPath to the "packages" folder relative to the "WEB-INF" directory of the application.
- 
FOLDER_WEBINFPath to the "WEB-INF" folder relative to the directory of the application.
- 
WORKPLACE_PATHThe workplace UI servlet name.- See Also:
 
- 
VFS_CONFIG_FOLDERThe VFS config files folder.- See Also:
 
- 
VFS_CONFIG_OVERRIDE_FOLDERThe folder to contain configuration file overrides.- See Also:
 
 
- 
- 
Constructor Details- 
CmsSystemInfopublic CmsSystemInfo()Creates a new system info container.
 
- 
- 
Method Details- 
getAbsoluteRfsPathRelativeToWebApplicationReturns an absolute path (to a directory or a file in the "real" file system) from a path relative to the web application folder of OpenCms.If the provided path is already absolute, then it is returned unchanged. If the provided path is a folder, the result will always end with a folder separator. - Parameters:
- path- the path (relative) to generate an absolute path from
- Returns:
- an absolute path (to a directory or a file) from a path relative to the web application folder of OpenCms
 
- 
getAbsoluteRfsPathRelativeToWebInfReturns an absolute path (to a directory or a file in the "real" file system) from a path relative to the "WEB-INF" folder of the OpenCms web application.If the provided path is already absolute, then it is returned unchanged. - Parameters:
- path- the path (relative) to generate an absolute path from
- Returns:
- an absolute path (to a directory or a file) from a path relative to the "WEB-INF" folder
 
- 
getBuildInfoReturns the map of additional build information that was contained in the version.properties file.The values are String arrays of length 2. First in this array is the actual value, and second the "nice name" for the value that can be used to display the value somewhere. In case no nice name was provided, the second value will repeat the key name. - Returns:
- the map of additional build information that was contained in the version.properties file
- Since:
- 9.5.0
 
- 
getConfigFilePathReturns the path to a configuration file.This will either be a file below /system/config/ or in case an override file exists below /system/config/overrides/. - Parameters:
- cms- the cms ontext
- configFile- the config file path within /system/config/
- Returns:
- the file path
 
- 
getConfigFolderGets the path of the opencms config folder.Per default this is the "/WEB-INF/config/ folder. If configured with the "-Dopencms.config=..." java startup parameter, OpenCms can access an external config folder outside its webapplication. - Returns:
- complete rfs path to the config folder.
 
- 
getConfigurationFileRfsPathReturns the absolute path to the "opencms.properties" configuration file (in the "real" file system).- Returns:
- the absolute path to the "opencms.properties" configuration file
 
- 
getContextPathReturns the web application context path, e.g. "" (empty String) if the web application is the default web application (usually "ROOT"), or "/opencms" if the web application is called "opencms".From the Java Servlet Specification v2.4: 
 Context Path: The path prefix associated with the ServletContext that this servlet is a part of. If this context is the "default" context rooted at the base of the web server's URL name space, this path will be an empty string. Otherwise, if the context is not rooted at the root of the server's name space, the path starts with a "/" character but does not end with a "/" character.- Returns:
- the web application context path
- See Also:
 
- 
getDefaultEncodingReturn the OpenCms default character encoding.The default is set in the opencms-system.xml file. If this is not set in opencms-system.xml the default is "UTF-8". - Returns:
- the default encoding, e.g. "UTF-8" or "ISO-8859-1"
 
- 
getDefaultWebApplicationNameReturns the default web application name (usually "ROOT").- Returns:
- the default web application name
 
- 
getDeviceSelectorGets the device selector.- Returns:
- the device selector
 
- 
getHistoryVersionsReturns the maximum number of versions that are kept per file in the VFS version history.If the version history is disabled, this setting has no effect. - Returns:
- the maximum number of versions that are kept per file
- See Also:
 
- 
getHistoryVersionsAfterDeletionReturns the number of versions in the VFS version history that should be kept after a resource is deleted.For resources in folders where the history.removedeleted property is set to "true", this setting is ignored. - Returns:
- the number versions in the VFS version history for deleted resources
 
- 
getHttpAuthenticationSettingsReturns the HTTP authentication settings.- Returns:
- the HTTP authentication settings
 
- 
getLogFileRfsFolderReturns the absolute path to the folder of the main OpenCms log file (in the "real" file system).If the method returns null, this means that the log file is not managed by OpenCms.- Returns:
- the absolute path to the folder of the main OpenCms log file (in the "real" file system)
 
- 
getLogFileRfsPathReturns the filename of the log file (in the "real" file system).If the method returns null, this means that the log file is not managed by OpenCms.- Returns:
- the filename of the log file (in the "real" file system)
 
- 
getMailSettingsReturns the settings for the internal OpenCms email service.- Returns:
- the settings for the internal OpenCms email service
 
- 
getNotificationProjectReturns the project in which time stamps for the content notification are read.- Returns:
- the project in which time stamps for the content notification are read
 
- 
getNotificationTimeReturns the duration after which responsible resource owners will be notified about out-dated content (in days).- Returns:
- the duration after which responsible resource owners will be notified about out-dated content
 
- 
getOpenCmsContextReturns the OpenCms request context, e.g. "/opencms/opencms".The OpenCms context will always start with a "/" and never have a trailing "/". The OpenCms context is identical to getContexPath() + getServletPath().- Returns:
- the OpenCms request context, e.g. "/opencms/opencms"
- See Also:
 
- 
getPackagesRfsPathReturns the absolute path to the "packages" folder (in the "real" file system).- Returns:
- the absolute path to the "packages" folder
 
- 
getPersistenceFileRfsPathReturns the absolute path to the "persistence.xml" file (in the "real" file system).- Returns:
- the absolute path to the "persistence.xml" configuration file
 
- 
getRuntimeReturns the time this OpenCms instance is running in milliseconds.- Returns:
- the time this OpenCms instance is running in milliseconds
 
- 
getServerNameReturns the OpenCms server name, e.g. "OpenCmsServer".The server name is set in opencms.properties. It is not related to any DNS name the server might also have. The server name is useful e.g. in a cluster to distinguish different servers, or if you compare log files from multiple servers.- Returns:
- the OpenCms server name
 
- 
getServletContainerSettingsReturns the servlet container specific settings.- Returns:
- the servlet container specific settings
 
- 
getServletPathReturns the OpenCms servlet path, e.g. "/opencms".From the Java Servlet Specification v2.4: 
 Servlet Path: The path section that directly corresponds to the mapping which activated this request. This path starts with a?/? character except in the case where the request is matched with the ?/*? pattern, in which case it is the empty string.- Returns:
- the OpenCms servlet path
- See Also:
 
- 
getStartupTimeReturns the time this OpenCms instance was started in milliseconds.- Returns:
- the time this OpenCms instance was started in milliseconds
 
- 
getStaticResourceContextReturns the context for static resources served from the class path, e.g. "/opencms/opencms/handleStatic".- Returns:
- the static resource context
 
- 
getVersionReturns the identifier "OpenCms/" plus the OpenCms version number.This information is used for example to identify OpenCms in HTTP response headers. - Returns:
- the identifier "OpenCms/" plus the OpenCms version number
 
- 
getVersionIdReturns the version ID of this OpenCms system.The version ID is usually set dynamically by the build system. It can be used to identify intermediate builds when the main version number has not changed. - Returns:
- the version ID of this OpenCms system
- Since:
- 9.5.0
 
- 
getVersionNumberReturns the version number of this OpenCms system, for example9.5.0.- Returns:
- the version number of this OpenCms system
- Since:
- 7.0.2
 
- 
getWebApplicationNameReturns the OpenCms web application name, e.g. "opencms" or "ROOT" (no leading or trailing "/").The web application name is stored for informational purposes only. If you want to construct an URI, use either getContextPath()andgetServletPath(), or for links to the OpenCms VFS usegetOpenCmsContext().- Returns:
- the OpenCms web application name
- See Also:
 
- 
getWebApplicationRfsPathReturns the OpenCms web application folder in the servlet container.- Returns:
- the OpenCms web application folder in the servlet container
 
- 
getWebInfRfsPathReturns the OpenCms web application "WEB-INF" directory path.- Returns:
- the OpenCms web application "WEB-INF" directory path
 
- 
getWorkplaceContextReturns the OpenCms workplace request context, e.g. "/opencms/workplace".The OpenCms workplace context will always start with a "/" and never have a trailing "/". The OpenCms context is identical to getContexPath() + WORKPLACE_PATH.- Returns:
- the OpenCms request context, e.g. "/opencms/workplace"
- See Also:
 
- 
isHistoryEnabledReturns if the VFS version history is enabled.- Returns:
- if the VFS version history is enabled
 
- 
isRestrictDetailContentsReturn true if detail contents are restricted to detail pages from the same site.- Returns:
- true if detail contents are restricted to detail pages from the same site
 
- 
setNotificationProjectSets the project in which time stamps for the content notification are read.- Parameters:
- notificationProject- the project in which time stamps for the content notification are read
 
- 
setNotificationTimeSets the duration after which responsible resource owners will be notified about out-dated content (in days).- Parameters:
- notificationTime- the duration after which responsible resource owners will be notified about out-dated content
 
- 
setVersionHistorySettingspublic void setVersionHistorySettings(boolean historyEnabled, int historyVersions, int historyVersionsAfterDeletion) VFS version history settings are set here.- Parameters:
- historyEnabled- if true the history is enabled
- historyVersions- the maximum number of versions that are kept per VFS resource
- historyVersionsAfterDeletion- the maximum number of versions that are kept for deleted resources
 
- 
initSets the OpenCms web application "WEB-INF" directory path (in the "real" file system).- Parameters:
- settings- container specific information needed for this system info
 
- 
setDefaultEncodingSets the default encoding, called after the configuration files have been read.- Parameters:
- encoding- the default encoding to set
 
- 
setDeviceSelectorSets the device selector.- Parameters:
- selector- the device selector to set
 
- 
setHttpAuthenticationSettingsprotected void setHttpAuthenticationSettings(CmsHttpAuthenticationSettings httpAuthenticationSettings) Sets the HTTP authentication settings.- Parameters:
- httpAuthenticationSettings- the HTTP authentication settings to set
 
- 
setMailSettingsSets the settings for the internal OpenCms email service.- Parameters:
- mailSettings- the settings for the internal OpenCms email service to set
 
- 
setRestrictDetailContentsSets the value of the 'restrict detail contents' option.- Parameters:
- restrictDetailContents- the new value for the option
 
- 
setServerNameSets the server name.The server name is set in opencms.properties. It is not related to any DNS name the server might also have. The server name is useful e.g. in a cluster to distinguish different servers, or if you compare log files from multiple servers.- Parameters:
- serverName- the server name to set
 
 
-