Class RepositoryUtils
- java.lang.Object
-
- org.pentaho.platform.repository2.unified.RepositoryUtils
-
public class RepositoryUtils extends Object
Utility methods that can be applied on any IUnifiedRepository} User: dkincade
-
-
Constructor Summary
Constructors Constructor Description RepositoryUtils(org.pentaho.platform.api.repository2.unified.IUnifiedRepository repository)
Creates a new instance of this utility class with access to the specified repository
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.pentaho.platform.api.repository2.unified.RepositoryFile
createFile(String filePath, org.pentaho.platform.api.repository2.unified.IRepositoryFileData data, boolean createParentDirs, boolean versioned, String versionMessage)
Creates a new file that is known to not existorg.pentaho.platform.api.repository2.unified.RepositoryFile
getFile(String path, org.pentaho.platform.api.repository2.unified.IRepositoryFileData data, boolean createIfNotExist, boolean createParents, String versionMessage)
Returns the specified file from the current repository.org.pentaho.platform.api.repository2.unified.RepositoryFile
getFolder(String path, boolean createIfNotExist, boolean createParents, String versionMessage)
Returns the specified folder in the current repository.org.pentaho.platform.api.repository2.unified.RepositoryFile
getFolder(String path, org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl, boolean createIfNotExist, boolean createParents, String versionMessage)
org.pentaho.platform.api.repository2.unified.IUnifiedRepository
getRepository()
Returns theIUnifiedRepository
for this instanceorg.pentaho.platform.api.repository2.unified.RepositoryFile
saveFile(String filePath, org.pentaho.platform.api.repository2.unified.IRepositoryFileData data, boolean create, boolean overwrite, boolean createParentDirs, boolean versioned, String versionMessage)
Save the data to a file at the specified path.
-
-
-
Method Detail
-
getRepository
public org.pentaho.platform.api.repository2.unified.IUnifiedRepository getRepository()
Returns theIUnifiedRepository
for this instance
-
getFolder
public org.pentaho.platform.api.repository2.unified.RepositoryFile getFolder(String path, boolean createIfNotExist, boolean createParents, String versionMessage)
Returns the specified folder in the current repository. If it can not be found, it will optionally be created. The missing parent folders can also be created if needed- Parameters:
path
- the full path to the requested folder in the repositorycreateIfNotExist
-true
indicates the folder will be created if it doesn't existcreateParents
-true
indicates that any missing parent folders will be created if they do not existversionMessage
- the message used if any folders are created- Returns:
- the
RepositoryFile
of the request folders, ornull
if it does not exist and the parameters do not allow for it to be created
-
getFolder
public org.pentaho.platform.api.repository2.unified.RepositoryFile getFolder(String path, org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl, boolean createIfNotExist, boolean createParents, String versionMessage)
-
getFile
public org.pentaho.platform.api.repository2.unified.RepositoryFile getFile(String path, org.pentaho.platform.api.repository2.unified.IRepositoryFileData data, boolean createIfNotExist, boolean createParents, String versionMessage)
Returns the specified file from the current repository. If it can not be found, it will optionally be created. The missing parent folders can also be created if needed.- Parameters:
path
- the full path to the requested file in the repositorydata
- the data to put in the file if it does not exist ... usenull
at your discretioncreateIfNotExist
-true
indicates the file will be created if it doesn't existcreateParents
-true
indicates that any missing parent folders will be created if they do not existversionMessage
- the message used if the file or any folders are created- Returns:
- the
RepositoryFile
of the request file, ornull
if it does not exist and the parameters do not allow for it to be created
-
saveFile
public org.pentaho.platform.api.repository2.unified.RepositoryFile saveFile(String filePath, org.pentaho.platform.api.repository2.unified.IRepositoryFileData data, boolean create, boolean overwrite, boolean createParentDirs, boolean versioned, String versionMessage)
Save the data to a file at the specified path. It will create the file it is doesn't exist (ifcreate == true
), it will overwrite the file it it does exist (ifoverwrite == true
, and it will create any necessary parent directories (ifcreateParentDirs == true
- Parameters:
filePath
-data
-create
-overwrite
-createParentDirs
-- Returns:
-
createFile
protected org.pentaho.platform.api.repository2.unified.RepositoryFile createFile(String filePath, org.pentaho.platform.api.repository2.unified.IRepositoryFileData data, boolean createParentDirs, boolean versioned, String versionMessage)
Creates a new file that is known to not exist- Parameters:
filePath
- the full path to the filedata
- the data to be stored in the filecreateParentDirs
- indicates of the directory structure should be created if it doesn't existversionMessage
- the version message- Returns:
- the newly create
IRepositoryFile
ornull
if it couldn't be created
-
-