Class ZipExportProcessor
- java.lang.Object
-
- org.pentaho.platform.plugin.services.importexport.BaseExportProcessor
-
- org.pentaho.platform.plugin.services.importexport.ZipExportProcessor
-
- Direct Known Subclasses:
PentahoPlatformExporter
public class ZipExportProcessor extends BaseExportProcessor
-
-
Field Summary
Fields Modifier and Type Field Description protected ExportManifest
exportManifest
protected List<String>
localeExportList
protected String
path
protected boolean
withManifest
-
Fields inherited from class org.pentaho.platform.plugin.services.importexport.BaseExportProcessor
EXPORT_INFO_DATE_FORMAT, EXPORT_INFO_TIME_FORMAT, EXPORT_MANIFEST_FILENAME, EXPORT_TEMP_FILENAME_EXT, EXPORT_TEMP_FILENAME_PREFIX, LOCALE_EXT
-
-
Constructor Summary
Constructors Constructor Description ZipExportProcessor(String path, org.pentaho.platform.api.repository2.unified.IUnifiedRepository repository, boolean withManifest)
Encapsulates the logic of registering import handlers, generating the manifest, and performing the export
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addToManifest(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryFile)
create an entry in the export manifest for this file or folderprotected void
createLocales(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryFile, String filePath, boolean isFolder, OutputStream outputStream)
for each locale stored in in Jcr create a .locale file with the stored node propertiesvoid
exportDirectory(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryDir, OutputStream outputStream, String filePath)
void
exportFile(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryFile, OutputStream outputStream, String filePath)
ExportManifest
getExportManifest()
protected String
getFixedZipEntryName(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryFile, String filePath)
Take repository file path and local file path and return computed zip entry pathList<String>
getLocaleExportList()
get the list of files we are interested in supporting locale from Springprotected org.pentaho.platform.api.engine.IPentahoSession
getSession()
protected String
getZipEntryName(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryFile, String filePath)
protected boolean
isExportCandidate(String path)
File
performExport(org.pentaho.platform.api.repository2.unified.RepositoryFile exportRepositoryFile)
Performs the export process, returns a zip File objectvoid
setExportManifest(ExportManifest exportManifest)
void
setLocaleExportList(List<String> localeExportList)
-
Methods inherited from class org.pentaho.platform.plugin.services.importexport.BaseExportProcessor
addExportHandler, getPath, getUnifiedRepository, setPath, setUnifiedRepository
-
-
-
-
Field Detail
-
path
protected String path
-
exportManifest
protected ExportManifest exportManifest
-
withManifest
protected boolean withManifest
-
-
Constructor Detail
-
ZipExportProcessor
public ZipExportProcessor(String path, org.pentaho.platform.api.repository2.unified.IUnifiedRepository repository, boolean withManifest)
Encapsulates the logic of registering import handlers, generating the manifest, and performing the export
-
-
Method Detail
-
getSession
protected org.pentaho.platform.api.engine.IPentahoSession getSession()
-
performExport
public File performExport(org.pentaho.platform.api.repository2.unified.RepositoryFile exportRepositoryFile) throws ExportException, IOException
Performs the export process, returns a zip File object- Specified by:
performExport
in classBaseExportProcessor
- Throws:
ExportException
- indicates an error in import processingIOException
-
exportFile
public void exportFile(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryFile, OutputStream outputStream, String filePath) throws ExportException, IOException
- Specified by:
exportFile
in classBaseExportProcessor
- Parameters:
repositoryFile
-outputStream
-filePath
-- Throws:
ExportManifestFormatException
ExportException
IOException
-
addToManifest
protected void addToManifest(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryFile) throws ExportException
create an entry in the export manifest for this file or folder- Parameters:
repositoryFile
-- Throws:
ExportException
-
exportDirectory
public void exportDirectory(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryDir, OutputStream outputStream, String filePath) throws ExportException, IOException
- Specified by:
exportDirectory
in classBaseExportProcessor
- Parameters:
repositoryDir
-outputStream
-- Throws:
ExportException
IOException
-
isExportCandidate
protected boolean isExportCandidate(String path)
-
getFixedZipEntryName
protected String getFixedZipEntryName(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryFile, String filePath)
Take repository file path and local file path and return computed zip entry path- Parameters:
repositoryFile
-filePath
-- Returns:
-
getZipEntryName
protected String getZipEntryName(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryFile, String filePath)
-
createLocales
protected void createLocales(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryFile, String filePath, boolean isFolder, OutputStream outputStream) throws IOException
for each locale stored in in Jcr create a .locale file with the stored node properties- Parameters:
repositoryFile
-filePath
-isFolder
-outputStream
-- Throws:
IOException
-
getLocaleExportList
public List<String> getLocaleExportList()
get the list of files we are interested in supporting locale from Spring- Returns:
-
getExportManifest
public ExportManifest getExportManifest()
-
setExportManifest
public void setExportManifest(ExportManifest exportManifest)
-
-