public class CmsImportHelper
extends java.lang.Object
| 构造器和说明 |
|---|
CmsImportHelper(CmsImportParameters parameters)
Constructor.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cacheDtdSystemId(java.lang.String dtdSystemLocation,
java.lang.String dtdFilename,
java.lang.String dtdUrlPrefix)
Adds a new DTD system id prefix mapping for internal resolution
of external URLs.
|
void |
closeFile()
Closes the zip file.
|
byte[] |
getFileBytes(java.lang.String filename)
Returns a byte array containing the content of the file.
|
java.lang.String |
getFileName()
Returns the name of the import file, without zip extension.
|
java.io.InputStream |
getFileStream(java.lang.String fileName)
Returns a stream for the content of the file.
|
java.io.File |
getFolder()
Returns the RFS folder to import from.
|
java.lang.String |
getLocation(java.lang.Class<?> clazz)
Returns the class system location.
|
java.util.zip.ZipFile |
getZipFile()
Returns the RFS zip file to import from.
|
void |
openFile()
Opens the import file.
|
public CmsImportHelper(CmsImportParameters parameters)
parameters - the import parameters to usepublic void cacheDtdSystemId(java.lang.String dtdSystemLocation,
java.lang.String dtdFilename,
java.lang.String dtdUrlPrefix)
dtdSystemLocation - the internal system location of the DTD file, e.g. org/opencms/configuration/dtdFilename - the name of the DTD file, e.g. opencms-configuration.dtddtdUrlPrefix - the external system id prefix of the DTD file, e.g. http://www.opencms.org/dtd/6.0/I_CmsXmlConfigurationpublic void closeFile()
public byte[] getFileBytes(java.lang.String filename)
throws CmsImportExportException
filename - the name of the file to read, relative to the folder or zip fileCmsImportExportException - if something goes wrongpublic java.lang.String getFileName()
public java.io.InputStream getFileStream(java.lang.String fileName)
throws CmsImportExportException
fileName - the name of the file to stream, relative to the folder or zip fileCmsImportExportException - if something goes wrongpublic java.io.File getFolder()
public java.lang.String getLocation(java.lang.Class<?> clazz)
i.e: org/opencms/importexport
clazz - the class to get the location forpublic java.util.zip.ZipFile getZipFile()
public void openFile()
throws java.io.IOException
java.io.IOException - if the file could not be opened