|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.staticexport.CmsStaticExportManager
public class CmsStaticExportManager
Provides the functionality to export resources from the OpenCms VFS to the file system.
Field Summary | |
---|---|
static java.lang.String |
EXPORT_ATTRIBUTE_ERROR_MESSAGE
Marker for error message attribute. |
static java.lang.String |
EXPORT_ATTRIBUTE_ERROR_REQUEST_URI
Marker for error request uri attribute. |
static java.lang.String |
EXPORT_ATTRIBUTE_ERROR_SERVLET_NAME
Marker for error servlet name attribute. |
static java.lang.String |
EXPORT_ATTRIBUTE_ERROR_STATUS_CODE
Marker for error status code attribute. |
static java.lang.String |
EXPORT_BACKUP_FOLDER_NAME
Name for the backup folder default name. |
static java.lang.Integer |
EXPORT_DEFAULT_BACKUPS
Name for the default work path. |
static java.lang.String |
EXPORT_DEFAULT_FILE
Name for the folder default index file. |
static java.lang.String |
EXPORT_DEFAULT_WORKPATH
Name for the default work path. |
static int |
EXPORT_LINK_WITH_PARAMETER
Flag value for links without parameters. |
static int |
EXPORT_LINK_WITHOUT_PARAMETER
Flag value for links without parameters. |
static java.lang.String |
EXPORT_MARKER
Marker for externally redirected 404 uri's. |
static int |
HANDLER_FINISH_TIME
Time given (in seconds) to the static export handler to finish a publish task. |
Constructor Summary | |
---|---|
CmsStaticExportManager()
Creates a new static export property object. |
Method Summary | |
---|---|
void |
addExportRule(java.lang.String name,
java.lang.String description)
Adds a new export rule to the configuration. |
void |
addExportRuleRegex(java.lang.String regex)
Adds a regex to the latest export rule. |
void |
addExportRuleUri(java.lang.String exportUri)
Adds a export uri to the latest export rule. |
void |
addRfsRule(java.lang.String name,
java.lang.String description,
java.lang.String source,
java.lang.String rfsPrefix,
java.lang.String exportPath,
java.lang.String exportWorkPath,
java.lang.String exportBackups,
java.lang.String useRelativeLinks)
Adds a new rfs rule to the configuration. |
void |
addRfsRuleSystemRes(java.lang.String regex)
Adds a regex of related system resources to the latest rfs-rule. |
void |
cacheExportUri(java.lang.String rfsName,
java.lang.String vfsName,
java.lang.String parameters)
Caches a calculated export uri. |
void |
cacheOnlineLink(java.lang.Object linkName,
java.lang.Object vfsName)
Caches a calculated online link. |
protected void |
clearCaches(CmsEvent event)
Clears the caches in the export manager. |
void |
cmsEvent(CmsEvent event)
Implements the CmsEvent interface, the static export properties uses the events to clear the list of cached keys in case a project is published. |
protected void |
createExportBackupFolders(java.io.File staticExport,
java.lang.String exportPath,
int exportBackups,
java.lang.String ruleBackupExtension)
Creates the backup folders for the given export folder and deletes the oldest if the maximum number is reached. |
protected void |
createExportFolder(java.lang.String exportPath,
java.lang.String rfsName)
Creates the parent folder for a exported resource in the RFS. |
int |
export(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
CmsObject cms,
CmsStaticExportData data)
Exports the requested uri and at the same time writes the uri to the response output stream if required. |
void |
exportFullStaticRender(boolean purgeFirst,
I_CmsReport report)
Starts a complete static export of all resources. |
java.lang.String |
getAcceptCharsetHeader()
Returns the accept-charset header used for internal requests. |
java.lang.String |
getAcceptLanguageHeader()
Returns the accept-language header used for internal requests. |
CmsStaticExportData |
getCachedExportUri(java.lang.String rfsName)
Returns a cached export data for the given rfs name. |
java.lang.String |
getCachedOnlineLink(java.lang.String vfsName)
Returns a cached link for the given vfs name. |
java.lang.String |
getCacheKey(java.lang.String siteRoot,
java.lang.String uri)
Returns the key for the online, export and secure cache. |
java.lang.String |
getDefault()
Gets the default property value as a string representation. |
java.lang.String |
getDefaultAcceptCharsetHeader()
Returns the current default charset header. |
java.lang.String |
getDefaultAcceptLanguageHeader()
Returns the current default locale header. |
java.lang.String |
getDefaultRfsPrefix()
Returns the default prefix for exported links in the "real" file system. |
java.lang.Integer |
getExportBackups()
Returns the number of stored backups. |
CmsStaticExportData |
getExportData(javax.servlet.http.HttpServletRequest request,
CmsObject cms)
Returns the export data for the request, if null is returned no export is required. |
CmsStaticExportData |
getExportData(java.lang.String vfsName,
CmsObject cms)
Returns the export data for a requested resource, if null is returned no export is required. |
protected CmsStaticExportData |
getExportData(java.lang.String rfsName,
java.lang.String vfsName,
CmsObject cms)
Returns the export data for a requested resource, if null is returned no export is required. |
java.lang.String |
getExportEnabled()
Gets the export enabled value as a string representation. |
CmsExportFolderMatcher |
getExportFolderMatcher()
Returns the current folder matcher. |
java.util.List |
getExportFolderPatterns()
Returns list of resources patterns which are part of the export. |
java.util.List |
getExportHeaders()
Returns specific http headers for the static export. |
java.util.Map |
getExportnames()
Returns the list of all resources that have the "exportname" property set. |
java.lang.String |
getExportPath(java.lang.String vfsName)
Returns the export path for the static export, that is the folder where the static exported resources will be written to. |
java.lang.String |
getExportPathForConfiguration()
Returns the original configured export path for the static export without the complete rfs path, to be used when re-writing the configuration. |
boolean |
getExportPropertyDefault()
Returns true if the default value for the resource property "export" is true. |
java.util.List |
getExportRules()
Returns the export Rules. |
java.util.List |
getExportSuffixes()
Gets the list of resource suffixes which will be exported by default. |
java.lang.String |
getExportUrl()
Returns the export URL used for internal requests for exporting resources that require a request / response (like JSP). |
java.lang.String |
getExportUrlForConfiguration()
Returns the export URL used for internal requests with unsubstituted context values, to be used when re-writing the configuration. |
java.lang.String |
getExportUrlPrefix()
Returns the export URL used for internal requests for exporting resources that require a request / response (like JSP) without http://servername. |
java.lang.String |
getExportWorkPath()
Returns the export work path for the static export, that is the folder where the static exported resources will be written to during the export process. |
java.lang.String |
getExportWorkPathForConfiguration()
Returns the original configured export work path for the static export without the complete rfs path, to be used when re-writing the configuration. |
I_CmsStaticExportHandler |
getHandler()
Returns the configured static export handler class. |
I_CmsLinkSubstitutionHandler |
getLinkSubstitutionHandler()
Returns the configured link substitution handler class. |
java.lang.String |
getPlainExportOptimization()
Gets the plain export optimization value as a string representation. |
boolean |
getQuickPlainExport()
Returns true if the quick plain export is enabled. |
java.lang.String |
getRelativeLinks()
Gets the relative links value as a string representation. |
java.lang.String |
getRemoteAddr()
Returns the remote address used for internal requests. |
java.lang.String |
getRemoteAddress()
Returns the remote address. |
java.lang.String |
getRfsName(CmsObject cms,
java.lang.String vfsName)
Returns the static export rfs name for a given vfs resource. |
java.lang.String |
getRfsName(CmsObject cms,
java.lang.String vfsName,
java.lang.String parameters)
Returns the static export rfs name for a given vfs resource where the link to the resource includes request parameters. |
java.lang.String |
getRfsPrefix(java.lang.String vfsName)
Returns the prefix for exported links in the "real" file system. |
java.lang.String |
getRfsPrefixForConfiguration()
Returns the original configured prefix for exported links in the "real" file, to be used when re-writing the configuration. |
protected java.lang.String |
getRfsPrefixForRfsName(java.lang.String rfsName)
Returns the longest rfs prefix matching a given already translated rfs name. |
java.util.List |
getRfsRules()
Returns the rfs Rules. |
java.lang.String |
getTestResource()
Returns the vfs name of the test resource. |
java.lang.String |
getVfsName(CmsObject cms,
java.lang.String rfsName)
Returns the VFS name for the given RFS name, being the exact reverse of . |
protected java.lang.String |
getVfsNameInternal(CmsObject cms,
java.lang.String rfsName)
Returns the VFS name from a given RFS name. |
java.lang.String |
getVfsPrefix()
Returns the prefix for the internal in the VFS. |
java.lang.String |
getVfsPrefixForConfiguration()
Returns the original configured prefix for internal links in the VFS, to be used when re-writing the configuration. |
void |
initialize(CmsObject cms)
Initializes the static export manager with the OpenCms system configuration. |
protected java.lang.String |
insertContextStrings(java.lang.String path)
Substitutes the ${CONTEXT_NAME} and ${SERVLET_NAME} in a path with the real values. |
boolean |
isExportLink(CmsObject cms,
java.lang.String vfsName)
Checks if the static export is required for the given VFS resource. |
boolean |
isFullStaticExport()
Returns true if the export process is a full static export. |
boolean |
isSecureLink(CmsObject cms,
java.lang.String vfsName)
Returns true if the given VFS resource should be transported through a secure channel. |
boolean |
isSecureLink(CmsObject cms,
java.lang.String vfsName,
java.lang.String siteRoot)
Returns true if the given VFS resource that is located under the
given site root should be transported through a secure channel. |
boolean |
isStaticExportEnabled()
Returns true if the static export is enabled. |
boolean |
isSuffixExportable(java.lang.String resourceName)
Returns true if the given resource name is exportable because of it's suffix. |
boolean |
isUseTempDir()
Checks if we have to use temporary directories during export. |
protected boolean |
isValidRfsName(java.lang.String rfsName)
Returns true if the rfs Name match against any of the defined export urls. |
protected boolean |
isValidURL(java.lang.String inputString)
Checks if a String is a valid URL. |
protected java.lang.String |
normalizeExportPath(java.lang.String exportPath)
Returns a normalized export path. |
protected java.lang.String |
normalizeRfsPrefix(java.lang.String rfsPrefix)
Returns a normalized rfs prefix. |
boolean |
relativeLinksInExport(java.lang.String vfsName)
Returns true if the links in the static export should be relative. |
protected void |
scrubExportFolders(I_CmsReport report)
Scrubs all the "export" folders. |
void |
setAcceptCharsetHeader(java.lang.String value)
Sets the accept-charset header value. |
void |
setAcceptLanguageHeader(java.lang.String value)
Sets the accept-language header value. |
void |
setDefault(java.lang.String value)
Sets the default property value. |
void |
setExportBackups(java.lang.String backup)
Sets the number of backups for the static export. |
void |
setExportEnabled(java.lang.String value)
Sets the export enabled value. |
void |
setExportFolderPattern(java.lang.String folder)
Adds a resource pattern to the list of resources which are part of the export. |
void |
setExportHeader(java.lang.String exportHeader)
Sets specific http header for the static export. |
protected void |
setExportnames()
Set the list of all resources that have the "exportname" property set. |
void |
setExportPath(java.lang.String path)
Sets the path where the static export is written. |
void |
setExportSuffix(java.lang.String suffix)
Adds a suffix to the list of resource suffixes which will be exported by default. |
void |
setExportUrl(java.lang.String url)
Sets the export url. |
void |
setExportWorkPath(java.lang.String path)
Sets the path where the static export is temporarily written. |
void |
setHandler(java.lang.String handlerClassName)
Sets the link substitution handler class. |
void |
setLinkSubstitutionHandler(java.lang.String handlerClassName)
Sets the static export handler class. |
void |
setPlainExportOptimization(java.lang.String value)
Sets the plain export optimization value. |
void |
setRelativeLinks(java.lang.String value)
Sets the relative links value. |
void |
setRemoteAddr(java.lang.String addr)
Sets the remote address which will be used for internal requests during the static export. |
void |
setRfsPrefix(java.lang.String rfsPrefix)
Sets the prefix for exported links in the "real" file system. |
void |
setTestResource(java.lang.String testResource)
Sets the test resource. |
void |
setVfsPrefix(java.lang.String vfsPrefix)
Sets the prefix for internal links in the vfs. |
void |
shutDown()
Shuts down all this static export manager. |
protected void |
writeResource(javax.servlet.http.HttpServletRequest req,
java.lang.String exportPath,
java.lang.String rfsName,
CmsResource resource,
byte[] content)
Writes a resource to the given export path with the given rfs name and the given content. |
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 EXPORT_ATTRIBUTE_ERROR_MESSAGE
public static final java.lang.String EXPORT_ATTRIBUTE_ERROR_REQUEST_URI
public static final java.lang.String EXPORT_ATTRIBUTE_ERROR_SERVLET_NAME
public static final java.lang.String EXPORT_ATTRIBUTE_ERROR_STATUS_CODE
public static final java.lang.String EXPORT_BACKUP_FOLDER_NAME
public static final java.lang.Integer EXPORT_DEFAULT_BACKUPS
public static final java.lang.String EXPORT_DEFAULT_FILE
public static final java.lang.String EXPORT_DEFAULT_WORKPATH
public static final int EXPORT_LINK_WITH_PARAMETER
public static final int EXPORT_LINK_WITHOUT_PARAMETER
public static final java.lang.String EXPORT_MARKER
public static final int HANDLER_FINISH_TIME
Constructor Detail |
---|
public CmsStaticExportManager()
Method Detail |
---|
public void addExportRule(java.lang.String name, java.lang.String description)
name
- the name of the ruledescription
- the description for the rulepublic void addExportRuleRegex(java.lang.String regex)
regex
- the regex to addpublic void addExportRuleUri(java.lang.String exportUri)
exportUri
- the export uri to addpublic void addRfsRule(java.lang.String name, java.lang.String description, java.lang.String source, java.lang.String rfsPrefix, java.lang.String exportPath, java.lang.String exportWorkPath, java.lang.String exportBackups, java.lang.String useRelativeLinks)
name
- the name of the ruledescription
- the description for the rulesource
- the source regexrfsPrefix
- the url prefixexportPath
- the rfs export pathexportWorkPath
- the rfs export work pathexportBackups
- the number of backupsuseRelativeLinks
- the relative links valuepublic void addRfsRuleSystemRes(java.lang.String regex)
regex
- the regex to addpublic void cacheExportUri(java.lang.String rfsName, java.lang.String vfsName, java.lang.String parameters)
rfsName
- the name of the resource in the "real" file systemvfsName
- the name of the resource in the VFSparameters
- the optional parameters for the generation of the resourcepublic void cacheOnlineLink(java.lang.Object linkName, java.lang.Object vfsName)
linkName
- the linkvfsName
- the name of the VFS resourcepublic void cmsEvent(CmsEvent event)
cmsEvent
in interface I_CmsEventListener
event
- CmsEvent that has occurredpublic int export(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, CmsObject cms, CmsStaticExportData data) throws CmsException, java.io.IOException, javax.servlet.ServletException, CmsStaticExportException
req
- the current requestres
- the current responsecms
- an initialized cms context (should be initialized with the "Guest" user only)data
- the static export data set
CmsException
- in case of errors accessing the VFS
javax.servlet.ServletException
- in case of errors accessing the servlet
java.io.IOException
- in case of errors writing to the export output stream
CmsStaticExportException
- if static export is disabledpublic void exportFullStaticRender(boolean purgeFirst, I_CmsReport report) throws CmsException, java.io.IOException, javax.servlet.ServletException
purgeFirst
- flag to delete all resources in the export folder of the rfsreport
- an I_CmsReport instance to print output message, or null to write messages to the log file
CmsException
- in case of errors accessing the VFS
java.io.IOException
- in case of errors writing to the export output stream
javax.servlet.ServletException
- in case of errors accessing the servletpublic java.lang.String getAcceptCharsetHeader()
public java.lang.String getAcceptLanguageHeader()
public CmsStaticExportData getCachedExportUri(java.lang.String rfsName)
Please note that this export data contains only the vfs name and the parameters, not the resource itself. It can therefore not directly be used as a return value for the static export.
rfsName
- the name of the resource in the real file system to get the cached vfs resource name for
null
public java.lang.String getCachedOnlineLink(java.lang.String vfsName)
vfsName
- the name of the vfs resource to get the cached link for
public java.lang.String getCacheKey(java.lang.String siteRoot, java.lang.String uri)
siteRoot
- the site root of the resourceuri
- the URI of the resource
public java.lang.String getDefault()
"true"
or "false"
public java.lang.String getDefaultAcceptCharsetHeader()
public java.lang.String getDefaultAcceptLanguageHeader()
public java.lang.String getDefaultRfsPrefix()
public java.lang.Integer getExportBackups()
public CmsStaticExportData getExportData(javax.servlet.http.HttpServletRequest request, CmsObject cms)
request
- the request to check for export datacms
- an initialized cms context (should be initialized with the "Guest" user only
public CmsStaticExportData getExportData(java.lang.String vfsName, CmsObject cms)
vfsName
- the VFS name of the resource requestedcms
- an initialized cms context (should be initialized with the "Guest" user only
public java.lang.String getExportEnabled()
"true"
or "false"
public CmsExportFolderMatcher getExportFolderMatcher()
public java.util.List getExportFolderPatterns()
public java.util.List getExportHeaders()
If the header Cache-Control
is set, OpenCms will not use its default headers.
public java.util.Map getExportnames()
public java.lang.String getExportPath(java.lang.String vfsName)
The returned value will be a directory like prefix. The value is configured
in the opencms-importexport.xml
configuration file. An optimization
of the configured value will be performed, where all relative path information is resolved
(for example /export/../static
will be resolved to /export
.
Moreover, if the configured path ends with a /
, this will be cut off
(for example /export/
becomes /export
.
This is resource name based, and based on the rfs-rules defined in the
opencms-importexport.xml
configuration file.
vfsName
- the name of the resource to export
getRfsPrefix(String)
,
getVfsPrefix()
public java.lang.String getExportPathForConfiguration()
This is required only to serialize the configuration again exactly as it was configured.
This method should not be used otherwise. Use
to obtain the export path to use when exporting.getExportPath(String)
public boolean getExportPropertyDefault()
public java.util.List getExportRules()
public java.util.List getExportSuffixes()
public java.lang.String getExportUrl()
public java.lang.String getExportUrlForConfiguration()
This is required only to serialize the configuration again exactly as it was configured.
This method should not be used otherwise. Use
to obtain the export path to use when exporting.getExportUrl()
public java.lang.String getExportUrlPrefix()
public java.lang.String getExportWorkPath()
public java.lang.String getExportWorkPathForConfiguration()
public I_CmsStaticExportHandler getHandler()
If not set, a new
is created and returned.CmsAfterPublishStaticExportHandler
public I_CmsLinkSubstitutionHandler getLinkSubstitutionHandler()
If not set, a new
is created and returned.CmsDefaultLinkSubstitutionHandler
public java.lang.String getPlainExportOptimization()
"true"
or "false"
public boolean getQuickPlainExport()
public java.lang.String getRelativeLinks()
"true"
or "false"
public java.lang.String getRemoteAddr()
public java.lang.String getRemoteAddress()
public java.lang.String getRfsName(CmsObject cms, java.lang.String vfsName)
cms
- an initialized cms contextvfsName
- the name of the vfs resource
getVfsName(CmsObject, String)
,
getRfsName(CmsObject, String, String)
public java.lang.String getRfsName(CmsObject cms, java.lang.String vfsName, java.lang.String parameters)
cms
- an initialized cms contextvfsName
- the name of the vfs resourceparameters
- the parameters of the link pointing to the resource
public java.lang.String getRfsPrefix(java.lang.String vfsName)
The returned value will be a directory like prefix. The value is configured
in the opencms-importexport.xml
configuration file. An optimization
of the configured value will be performed, where all relative path information is resolved
(for example /export/../static
will be resolved to /export
.
Moreover, if the configured path ends with a /
, this will be cut off
(for example /export/
becomes /export
.
This is resource name based, and based on the rfs-rules defined in the
opencms-importexport.xml
configuration file.
vfsName
- the name of the resource to export
getExportPath(String)
,
getVfsPrefix()
public java.lang.String getRfsPrefixForConfiguration()
This is required only to serialize the configuration again exactly as it was configured.
This method should not be used otherwise. Use
to obtain the rfs prefix to use for the exported links.getRfsPrefix(String)
public java.util.List getRfsRules()
public java.lang.String getTestResource()
public java.lang.String getVfsName(CmsObject cms, java.lang.String rfsName)
getRfsName(CmsObject, String)
.
Returns null
if no matching VFS resource can be found for the given RFS name.
cms
- the current users OpenCms contextrfsName
- the RFS name to get the VFS name for
null
if the RFS name does not match to the VFSgetRfsName(CmsObject, String)
public java.lang.String getVfsPrefix()
The returned value will be a directory like prefix. The value is configured
in the opencms-importexport.xml
configuration file. An optimization
of the configured value will be performed, where all relative path information is resolved
(for example /opencms/../mycms
will be resolved to /mycms
.
Moreover, if the configured path ends with a /
, this will be cut off
(for example /opencms/
becomes /opencms
.
getExportPath(String)
,
getRfsPrefix(String)
public java.lang.String getVfsPrefixForConfiguration()
This is required only to serialize the configuration again exactly as it was configured.
This method should not be used otherwise. Use
to obtain the VFS prefix to use for the internal links.getVfsPrefix()
public void initialize(CmsObject cms)
cms
- an OpenCms context objectpublic boolean isExportLink(CmsObject cms, java.lang.String vfsName)
Please note that the given OpenCms user context is NOT used to read the resource. The check for export is always done with the permissions of the "Export" user. The provided user context is just used to get the current site root.
Since the "Export" user always operates in the "Online" project, the resource is also read from the "Online" project, not from the current project of the given OpenCms context.
cms
- the current users OpenCms contextvfsName
- the VFS resource name to check
true
if static export is required for the given VFS resourcepublic boolean isFullStaticExport()
public boolean isSecureLink(CmsObject cms, java.lang.String vfsName)
true
if the given VFS resource should be transported through a secure channel.
The secure mode is only checked in the "Online" project.
If the given OpenCms context is currently not in the "Online" project,
false
is returned.
The given resource is read from the site root of the provided OpenCms context.
cms
- the current users OpenCms contextvfsName
- the VFS resource name to check
true
if the given VFS resource should be transported through a secure channelisSecureLink(CmsObject, String, String)
public boolean isSecureLink(CmsObject cms, java.lang.String vfsName, java.lang.String siteRoot)
true
if the given VFS resource that is located under the
given site root should be transported through a secure channel.
cms
- the current users OpenCms contextvfsName
- the VFS resource name to checksiteRoot
- the site root where the the VFS resource should be read
true
if the given VFS resource should be transported through a secure channelisSecureLink(CmsObject, String)
public boolean isStaticExportEnabled()
public boolean isSuffixExportable(java.lang.String resourceName)
resourceName
- the name to check
public boolean isUseTempDir()
true
if using temporary directoriespublic boolean relativeLinksInExport(java.lang.String vfsName)
vfsName
- the name of the resource to export
public void setAcceptCharsetHeader(java.lang.String value)
value
- accept-language header valuepublic void setAcceptLanguageHeader(java.lang.String value)
value
- accept-language header valuepublic void setDefault(java.lang.String value)
value
- must be true
or false
public void setExportBackups(java.lang.String backup)
backup
- number of backupspublic void setExportEnabled(java.lang.String value)
value
- must be true
or false
public void setExportFolderPattern(java.lang.String folder)
folder
- the folder pattern to add to the list.public void setExportHeader(java.lang.String exportHeader)
The format of the headers must be "header:value".
exportHeader
- a specific http headerpublic void setExportPath(java.lang.String path)
path
- the path where the static export is writtenpublic void setExportSuffix(java.lang.String suffix)
suffix
- the suffix to add to the list.public void setExportUrl(java.lang.String url)
url
- the export urlpublic void setExportWorkPath(java.lang.String path)
path
- the path where the static export is temporarily writtenpublic void setHandler(java.lang.String handlerClassName)
handlerClassName
- the link substitution handler class namepublic void setLinkSubstitutionHandler(java.lang.String handlerClassName)
handlerClassName
- the static export handler class namepublic void setPlainExportOptimization(java.lang.String value)
value
- must be true
or false
public void setRelativeLinks(java.lang.String value)
value
- must be true
or false
public void setRemoteAddr(java.lang.String addr)
addr
- the remote address to be usedpublic void setRfsPrefix(java.lang.String rfsPrefix)
rfsPrefix
- the prefix for exported links in the "real" file systempublic void setTestResource(java.lang.String testResource)
testResource
- the vfs name of the test resourcepublic void setVfsPrefix(java.lang.String vfsPrefix)
vfsPrefix
- the prefix for internal links in the vfspublic void shutDown()
This is required since there may still be a thread running when the system is being shut down.
protected void clearCaches(CmsEvent event)
event
- the event that requested to clear the cachesprotected void createExportBackupFolders(java.io.File staticExport, java.lang.String exportPath, int exportBackups, java.lang.String ruleBackupExtension)
staticExport
- folder for which a new backup folder has to be createdexportPath
- export path to create backup path out of itexportBackups
- number of maximumruleBackupExtension
- extension for rule based backupsprotected void createExportFolder(java.lang.String exportPath, java.lang.String rfsName) throws CmsException
exportPath
- the path to export the filerfsName
- the rfs name of the resource
CmsException
- if the folder could not be createdprotected CmsStaticExportData getExportData(java.lang.String rfsName, java.lang.String vfsName, CmsObject cms)
rfsName
- the RFS name of the resource requestedvfsName
- the VFS name of the resource requestedcms
- an initialized cms context (should be initialized with the "Guest" user only
protected java.lang.String getRfsPrefixForRfsName(java.lang.String rfsName)
rfsName
- the rfs name
getRfsPrefix(String)
protected java.lang.String getVfsNameInternal(CmsObject cms, java.lang.String rfsName)
The RFS name must not contain the RFS prefix.
cms
- an initialized OpenCms user contextrfsName
- the name of the RFS resource
protected java.lang.String insertContextStrings(java.lang.String path)
path
- the path to substitute
protected boolean isValidRfsName(java.lang.String rfsName)
rfsName
- the rfs Name to validate
protected boolean isValidURL(java.lang.String inputString)
inputString
- The String to check can be null
true
if the String is not null
and a valid URLprotected java.lang.String normalizeExportPath(java.lang.String exportPath)
Replacing macros, normalizing the path and taking care of relative paths.
exportPath
- the export path to normalize
protected java.lang.String normalizeRfsPrefix(java.lang.String rfsPrefix)
Replacing macros and normalizing the path.
rfsPrefix
- the prefix to normalize
protected void scrubExportFolders(I_CmsReport report)
report
- an I_CmsReport instance to print output message, or null to write messages to the log fileprotected void setExportnames()
protected void writeResource(javax.servlet.http.HttpServletRequest req, java.lang.String exportPath, java.lang.String rfsName, CmsResource resource, byte[] content) throws CmsException
req
- the current requestexportPath
- the path to export the resourcerfsName
- the rfs nameresource
- the resourcecontent
- the content
CmsException
- if something goes wrong
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |