public class RepositoryUtils extends Object
Constructor and Description |
---|
RepositoryUtils(IUnifiedRepository repository)
Creates a new instance of this utility class with access to the specified repository
|
Modifier and Type | Method and Description |
---|---|
protected RepositoryFile |
createFile(String filePath,
IRepositoryFileData data,
boolean createParentDirs,
boolean versioned,
String versionMessage)
Creates a new file that is known to not exist
|
RepositoryFile |
getFile(String path,
IRepositoryFileData data,
boolean createIfNotExist,
boolean createParents,
String versionMessage)
Returns the specified file from the current repository.
|
RepositoryFile |
getFolder(String path,
boolean createIfNotExist,
boolean createParents,
String versionMessage)
Returns the specified folder in the current repository.
|
RepositoryFile |
getFolder(String path,
RepositoryFileAcl acl,
boolean createIfNotExist,
boolean createParents,
String versionMessage) |
IUnifiedRepository |
getRepository()
Returns the
IUnifiedRepository for this instance |
RepositoryFile |
saveFile(String filePath,
IRepositoryFileData data,
boolean create,
boolean overwrite,
boolean createParentDirs,
boolean versioned,
String versionMessage)
Save the data to a file at the specified path.
|
public RepositoryUtils(IUnifiedRepository repository)
public IUnifiedRepository getRepository()
IUnifiedRepository
for this instancepublic RepositoryFile getFolder(String path, boolean createIfNotExist, boolean createParents, String versionMessage)
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 createdRepositoryFile
of the request folders, or null
if it does not exist and the
parameters do not allow for it to be createdpublic RepositoryFile getFolder(String path, RepositoryFileAcl acl, boolean createIfNotExist, boolean createParents, String versionMessage)
public RepositoryFile getFile(String path, IRepositoryFileData data, boolean createIfNotExist, boolean createParents, String versionMessage)
path
- the full path to the requested file in the repositorydata
- the data to put in the file if it does not exist ... use null
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 createdRepositoryFile
of the request file, or null
if it does not exist and the
parameters do not allow for it to be createdpublic RepositoryFile saveFile(String filePath, IRepositoryFileData data, boolean create, boolean overwrite, boolean createParentDirs, boolean versioned, String versionMessage)
create == true
), it will overwrite the file it it does exist (if overwrite == true
, and it
will create any necessary parent directories (if createParentDirs == true
filePath
- data
- create
- overwrite
- createParentDirs
- protected RepositoryFile createFile(String filePath, IRepositoryFileData data, boolean createParentDirs, boolean versioned, String versionMessage)
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 messageIRepositoryFile
or null
if it couldn't be createdCopyright © 2017 Hitachi Vantara. All rights reserved.