|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.importexport.CmsExportHelper
public class CmsExportHelper
Wrapper to write exported OpenCms resources either to a .ZIP file or to the file system.
Constructor Summary | |
---|---|
CmsExportHelper(java.lang.String exportPath,
boolean exportAsFiles,
boolean validateXml)
Creates a new export helper. |
Method Summary | |
---|---|
protected java.lang.String |
getRfsFileName(java.lang.String name)
Returns the RFS file name for the given OpenCms VFS file name. |
org.dom4j.io.SAXWriter |
getSaxWriter()
Returns the SAX writer for the Manifest file. |
protected void |
removeOldExport(java.lang.String exportPath)
Removes the old export output, which may be an existing file or directory. |
void |
writeFile(CmsFile file,
java.lang.String name)
Writes a single OpenCms VFS file to the export. |
protected void |
writeFile2Rfs(CmsFile file,
java.lang.String name)
Writes a single OpenCms VFS file to the RFS export. |
protected void |
writeFile2Zip(CmsFile file,
java.lang.String name)
Writes a single OpenCms VFS file to the ZIP export. |
void |
writeManifest(CmsXmlSaxWriter xmlSaxWriter)
Writes the OpenCms manifest.xml file to the export. |
protected void |
writeManifest2Rfs(CmsXmlSaxWriter xmlSaxWriter)
Writes the OpenCms manifest.xml file to the RFS export. |
protected void |
writeManifest2Zip(CmsXmlSaxWriter xmlSaxWriter)
Writes the OpenCms manifest.xml file to the ZIP export. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CmsExportHelper(java.lang.String exportPath, boolean exportAsFiles, boolean validateXml) throws org.xml.sax.SAXException, java.io.IOException
exportPath
- the export pathexportAsFiles
- indicates if the resources should be exported as individual files or in one big ZIP filevalidateXml
- indicates of the manifest.xml should be validated
org.xml.sax.SAXException
- in case of issues creating the manifest.xml
java.io.IOException
- in case of file access issuesMethod Detail |
---|
public org.dom4j.io.SAXWriter getSaxWriter()
public void writeFile(CmsFile file, java.lang.String name) throws java.io.IOException
file
- the OpenCms VFS file to writename
- the name of the file in the export
java.io.IOException
- in case of file access issuespublic void writeManifest(CmsXmlSaxWriter xmlSaxWriter) throws java.io.IOException, org.xml.sax.SAXException
xmlSaxWriter
- the SAX writer to use
org.xml.sax.SAXException
- in case of issues creating the manifest.xml
java.io.IOException
- in case of file access issuesprotected java.lang.String getRfsFileName(java.lang.String name)
name
- the OpenCms VFS file name
protected void removeOldExport(java.lang.String exportPath)
exportPath
- the export output pathprotected void writeFile2Rfs(CmsFile file, java.lang.String name) throws java.io.IOException
file
- the OpenCms VFS file to writename
- the name of the file in the export
java.io.IOException
- in case of file access issuesprotected void writeFile2Zip(CmsFile file, java.lang.String name) throws java.io.IOException
file
- the OpenCms VFS file to writename
- the name of the file in the export
java.io.IOException
- in case of file access issuesprotected void writeManifest2Rfs(CmsXmlSaxWriter xmlSaxWriter) throws org.xml.sax.SAXException, java.io.IOException
In case of the RFS export the file is directly written to a file output stream, so calling this method just closes the XML and finishes the stream.
xmlSaxWriter
- the SAX writer to use
org.xml.sax.SAXException
- in case of issues creating the manifest.xml
java.io.IOException
- in case of issues closing the file writerprotected void writeManifest2Zip(CmsXmlSaxWriter xmlSaxWriter) throws java.io.IOException, org.xml.sax.SAXException
In case of the ZIP export the manifest is written to an internal StringBuffer first, which is then stored in the ZIP file when this method is called.
xmlSaxWriter
- the SAX writer to use
org.xml.sax.SAXException
- in case of issues creating the manifest.xml
java.io.IOException
- in case of file access issues
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |