|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.main.CmsSystemInfo
public class CmsSystemInfo
Provides access to system wide "read only" information.
Regarding the naming conventions used, this comes straight from the Servlet Spec v2.4:
SRV.3.1 Introduction to the ServletContext Interface
[...] A ServletContext is rooted at a known path within a web server. For example
a servlet context could be located at http://www.mycorp.com/catalog. All
requests that begin with the /catalog request path, known as the context path, are
routed to the web application associated with the ServletContext.
Field Summary | |
---|---|
static java.lang.String |
FILE_PROPERTIES
The name of the opencms.properties file. |
static java.lang.String |
FOLDER_CONFIG
Path to the "config" folder relative to the "WEB-INF" directory of the application. |
static java.lang.String |
FOLDER_MODULES
The name of the module folder in the package path. |
static java.lang.String |
FOLDER_PACKAGES
Path to the "packages" folder relative to the "WEB-INF" directory of the application. |
static java.lang.String |
FOLDER_WEBINF
Path to the "WEB-INF" folder relative to the directory of the application. |
Constructor Summary | |
---|---|
CmsSystemInfo()
Creates a new system info container. |
Method Summary | |
---|---|
java.lang.String |
getAbsoluteRfsPathRelativeToWebApplication(java.lang.String path)
Returns 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. |
java.lang.String |
getAbsoluteRfsPathRelativeToWebInf(java.lang.String path)
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. |
java.lang.String |
getConfigurationFileRfsPath()
Returns the absolute path to the "opencms.properties" configuration file (in the "real" file system). |
java.lang.String |
getContextPath()
Returns 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". |
java.lang.String |
getDefaultEncoding()
Return the OpenCms default character encoding. |
java.lang.String |
getDefaultWebApplicationName()
Returns the default web application name (usually "ROOT"). |
int |
getHistoryVersions()
Returns the maximum number of versions that are kept per file in the VFS version history. |
int |
getHistoryVersionsAfterDeletion()
Returns the number of versions in the VFS version history that should be kept after a resource is deleted. |
CmsHttpAuthenticationSettings |
getHttpAuthenticationSettings()
Returns the HTTP authentication settings. |
java.lang.String |
getLogFileRfsPath()
Returns the filename of the log file (in the "real" file system). |
CmsMailSettings |
getMailSettings()
Returns the settings for the internal OpenCms email service. |
java.lang.String |
getNotificationProject()
Returns the project in which time stamps for the content notification are read. |
int |
getNotificationTime()
Returns the duration after which responsible resource owners will be notified about out-dated content (in days). |
java.lang.String |
getOpenCmsContext()
Returns the OpenCms request context, e.g. |
java.lang.String |
getPackagesRfsPath()
Returns the absolute path to the "packages" folder (in the "real" file system). |
long |
getRuntime()
Returns the time this OpenCms instance is running in milliseconds. |
java.lang.String |
getServerName()
Returns the OpenCms server name, e.g. |
CmsServletContainerSettings |
getServletContainerSettings()
Returns the servlet container specific settings. |
java.lang.String |
getServletPath()
Returns the OpenCms servlet path, e.g. |
long |
getStartupTime()
Returns the time this OpenCms instance was started in milliseconds. |
java.lang.String |
getVersion()
Returns the identifier "OpenCms/" plus the OpenCms version number. |
java.lang.String |
getVersionName()
Deprecated. use getVersionNumber() instead |
java.lang.String |
getVersionNumber()
Returns the version number of this OpenCms system, for example 7.0.0 . |
java.lang.String |
getWebApplicationName()
Returns the OpenCms web application name, e.g. |
java.lang.String |
getWebApplicationRfsPath()
Returns the OpenCms web application folder in the servlet container. |
java.lang.String |
getWebInfRfsPath()
Returns the OpenCms web application "WEB-INF" directory path. |
protected void |
init(CmsServletContainerSettings settings)
Sets the OpenCms web application "WEB-INF" directory path (in the "real" file system). |
boolean |
isHistoryEnabled()
Returns if the VFS version history is enabled. |
protected void |
setDefaultEncoding(java.lang.String encoding)
Sets the default encoding, called after the configuration files have been read. |
protected void |
setHttpAuthenticationSettings(CmsHttpAuthenticationSettings httpAuthenticationSettings)
Sets the HTTP authentication settings. |
protected void |
setMailSettings(CmsMailSettings mailSettings)
Sets the settings for the internal OpenCms email service. |
void |
setNotificationProject(java.lang.String notificationProject)
Sets the project in which time stamps for the content notification are read. |
void |
setNotificationTime(int notificationTime)
Sets the duration after which responsible resource owners will be notified about out-dated content (in days). |
protected void |
setServerName(java.lang.String serverName)
Sets the server name. |
void |
setVersionHistorySettings(boolean historyEnabled,
int historyVersions,
int historyVersionsAfterDeletion)
VFS version history settings are set here. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FILE_PROPERTIES
public static final java.lang.String FOLDER_CONFIG
public static final java.lang.String FOLDER_MODULES
public static final java.lang.String FOLDER_PACKAGES
public static final java.lang.String FOLDER_WEBINF
Constructor Detail |
---|
public CmsSystemInfo()
Method Detail |
---|
public java.lang.String getAbsoluteRfsPathRelativeToWebApplication(java.lang.String path)
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.
path
- the path (relative) to generate an absolute path from
public java.lang.String getAbsoluteRfsPathRelativeToWebInf(java.lang.String path)
If the provided path is already absolute, then it is returned unchanged.
path
- the path (relative) to generate an absolute path from
public java.lang.String getConfigurationFileRfsPath()
public java.lang.String getContextPath()
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.
getWebApplicationName()
,
getServletPath()
,
getOpenCmsContext()
public java.lang.String getDefaultEncoding()
The default is set in the opencms-system.xml file. If this is not set in opencms-system.xml the default is "UTF-8".
public java.lang.String getDefaultWebApplicationName()
public int getHistoryVersions()
If the version history is disabled, this setting has no effect.
isHistoryEnabled()
public int getHistoryVersionsAfterDeletion()
public CmsHttpAuthenticationSettings getHttpAuthenticationSettings()
public java.lang.String getLogFileRfsPath()
If the method returns null
, this means that the log
file is not managed by OpenCms.
public CmsMailSettings getMailSettings()
public java.lang.String getNotificationProject()
public int getNotificationTime()
public java.lang.String getOpenCmsContext()
The OpenCms context will always start with a "/" and never have a trailing "/".
The OpenCms context is identical to getContexPath() + getServletPath()
.
getContextPath()
,
getServletPath()
public java.lang.String getPackagesRfsPath()
public long getRuntime()
public java.lang.String getServerName()
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.
public CmsServletContainerSettings getServletContainerSettings()
public java.lang.String getServletPath()
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.
getContextPath()
,
getWebApplicationName()
,
getOpenCmsContext()
public long getStartupTime()
public java.lang.String getVersion()
This information is used for example to identify OpenCms in HTTP response headers.
public java.lang.String getVersionName()
getVersionNumber()
instead
7.0.0
.
public java.lang.String getVersionNumber()
7.0.0
.
public java.lang.String getWebApplicationName()
The web application name is stored for informational purposes only.
If you want to construct an URI, use either getContextPath()
and
getServletPath()
, or for links to the OpenCms VFS use getOpenCmsContext()
.
getContextPath()
,
getServletPath()
,
getOpenCmsContext()
public java.lang.String getWebApplicationRfsPath()
public java.lang.String getWebInfRfsPath()
public boolean isHistoryEnabled()
public void setNotificationProject(java.lang.String notificationProject)
notificationProject
- the project in which time stamps for the content notification are readpublic void setNotificationTime(int notificationTime)
notificationTime
- the duration after which responsible resource owners will be notified about out-dated contentpublic void setVersionHistorySettings(boolean historyEnabled, int historyVersions, int historyVersionsAfterDeletion)
historyEnabled
- if true the history is enabledhistoryVersions
- the maximum number of versions that are kept per VFS resourcehistoryVersionsAfterDeletion
- the maximum number of versions that are kept for deleted resourcesprotected void init(CmsServletContainerSettings settings)
settings
- container specific information needed for this system infoprotected void setDefaultEncoding(java.lang.String encoding)
encoding
- the default encoding to setprotected void setHttpAuthenticationSettings(CmsHttpAuthenticationSettings httpAuthenticationSettings)
httpAuthenticationSettings
- the HTTP authentication settings to setprotected void setMailSettings(CmsMailSettings mailSettings)
mailSettings
- the settings for the internal OpenCms email service to setprotected void setServerName(java.lang.String serverName)
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.
serverName
- the server name to set
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |