Class RepositoryFileImportFileHandler
- java.lang.Object
-
- org.pentaho.platform.plugin.services.importer.RepositoryFileImportFileHandler
-
- All Implemented Interfaces:
IPlatformImportHandler
- Direct Known Subclasses:
LocaleImportHandler
,PDIImportFileHandler
,PRPTImportHandler
,XActionImportHandler
public class RepositoryFileImportFileHandler extends Object implements IPlatformImportHandler
User: nbaker Date: 5/29/12
-
-
Constructor Summary
Constructors Constructor Description RepositoryFileImportFileHandler(List<org.pentaho.platform.api.mimetype.IMimeType> mimeTypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
copyFileToRepository(RepositoryFileImportBundle bundle, String repositoryPath, org.pentaho.platform.api.repository2.unified.RepositoryFile file)
Copies the file bundle into the repositoryprotected org.pentaho.platform.api.repository2.unified.RepositoryFile
createFile(RepositoryFileImportBundle bundle, String repositoryPath, org.pentaho.platform.api.repository2.unified.IRepositoryFileData data)
Creates a new file in the repositoryorg.pentaho.platform.api.repository2.unified.RepositoryFile
createFolderJustInTime(String folderPath, String manifestKey)
ImportSession
getImportSession()
List<String>
getKnownExtensions()
org.apache.commons.logging.Log
getLogger()
Map<String,org.pentaho.platform.api.mimetype.IMimeType>
getMimeTypeMap()
List<org.pentaho.platform.api.mimetype.IMimeType>
getMimeTypes()
protected Serializable
getParentId(String repositoryPath)
Returns the Id of the parent folder of the file path providedorg.pentaho.platform.api.repository2.unified.IUnifiedRepository
getRepository()
protected String
getTitle(String name)
truncate the extension from the file name for the extension only if it is file with known extensionvoid
importFile(org.pentaho.platform.api.repository2.unified.IPlatformImportBundle bnd)
Import the provided IPlatformImportBundle into the platform.void
setDefaultAclHandler(org.pentaho.platform.api.repository2.unified.IRepositoryDefaultAclHandler defaultAclHandler)
void
setKnownExtensions(List<String> knownExtensions)
void
setRepository(org.pentaho.platform.api.repository2.unified.IUnifiedRepository repository)
protected org.pentaho.platform.api.repository2.unified.RepositoryFile
updateFile(RepositoryFileImportBundle bundle, org.pentaho.platform.api.repository2.unified.RepositoryFile file, org.pentaho.platform.api.repository2.unified.IRepositoryFileData data)
Updates a file in the repository
-
-
-
Constructor Detail
-
RepositoryFileImportFileHandler
public RepositoryFileImportFileHandler(List<org.pentaho.platform.api.mimetype.IMimeType> mimeTypes)
-
-
Method Detail
-
getLogger
public org.apache.commons.logging.Log getLogger()
-
getImportSession
public ImportSession getImportSession()
-
importFile
public void importFile(org.pentaho.platform.api.repository2.unified.IPlatformImportBundle bnd) throws PlatformImportException
Description copied from interface:IPlatformImportHandler
Import the provided IPlatformImportBundle into the platform.- Specified by:
importFile
in interfaceIPlatformImportHandler
- Throws:
PlatformImportException
-
copyFileToRepository
protected boolean copyFileToRepository(RepositoryFileImportBundle bundle, String repositoryPath, org.pentaho.platform.api.repository2.unified.RepositoryFile file) throws PlatformImportException
Copies the file bundle into the repository- Parameters:
bundle
-repositoryPath
-file
-- Throws:
PlatformImportException
-
createFile
protected org.pentaho.platform.api.repository2.unified.RepositoryFile createFile(RepositoryFileImportBundle bundle, String repositoryPath, org.pentaho.platform.api.repository2.unified.IRepositoryFileData data) throws PlatformImportException
Creates a new file in the repository- Parameters:
bundle
-data
-- Throws:
PlatformImportException
-
updateFile
protected org.pentaho.platform.api.repository2.unified.RepositoryFile updateFile(RepositoryFileImportBundle bundle, org.pentaho.platform.api.repository2.unified.RepositoryFile file, org.pentaho.platform.api.repository2.unified.IRepositoryFileData data) throws PlatformImportException
Updates a file in the repository- Throws:
PlatformImportException
-
getTitle
protected String getTitle(String name)
truncate the extension from the file name for the extension only if it is file with known extension- Parameters:
name
-- Returns:
- title
-
getParentId
protected Serializable getParentId(String repositoryPath)
Returns the Id of the parent folder of the file path provided- Parameters:
repositoryPath
-- Returns:
-
getRepository
public org.pentaho.platform.api.repository2.unified.IUnifiedRepository getRepository()
-
setRepository
public void setRepository(org.pentaho.platform.api.repository2.unified.IUnifiedRepository repository)
-
setDefaultAclHandler
public void setDefaultAclHandler(org.pentaho.platform.api.repository2.unified.IRepositoryDefaultAclHandler defaultAclHandler)
-
createFolderJustInTime
public org.pentaho.platform.api.repository2.unified.RepositoryFile createFolderJustInTime(String folderPath, String manifestKey) throws PlatformImportException, org.pentaho.metadata.repository.DomainIdNullException, org.pentaho.metadata.repository.DomainAlreadyExistsException, org.pentaho.metadata.repository.DomainStorageException, IOException
- Throws:
PlatformImportException
org.pentaho.metadata.repository.DomainIdNullException
org.pentaho.metadata.repository.DomainAlreadyExistsException
org.pentaho.metadata.repository.DomainStorageException
IOException
-
getMimeTypes
public List<org.pentaho.platform.api.mimetype.IMimeType> getMimeTypes()
- Specified by:
getMimeTypes
in interfaceIPlatformImportHandler
-
-