|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RepositoryResourceService
A service for manipulating resources in the repository.
Repository files are typically modified by checking them out into a user's workspace, modifying the file in the workspace, and then when the user is satisfied with the modifications the updated file is checked back into the repository.
Repository files can be either versioned or unversioned.
When an unversioned file is updated, its contents are replaced by the new content. When a versioned file is updated, a new version of that resource is created with its new version number specified
by a ResourceCheckinSpecification
. The ResourceCheckinSpecification indicates
that the major or minor number field should be incremented or specifies the exact version label to be used for this update. New version labels
must always be an increase of the previous label.
Method Summary | |
---|---|
void |
checkinFileFromWorkspace(String path,
ResourceCheckinSpecification checkinSpecification)
Check in the contents of this resource from the current user's workspace to the repository. |
void |
checkoutFileToWorkspace(String path)
Checkout the specified resource from the repository and into the current user's workspace. |
void |
checkoutFileToWorkspaceAndDownload(String path,
String localFilePath)
Checkout the specified resource from the repository to the current user's workspace, and then download the content of the workspace file to the specified local file path. |
RepositoryResource |
copy(String sourcePath,
String destinationPath)
Copy the file or folder from sourcePath into targetFolder and give the new copy the name newName. |
RepositoryFile |
createFile(String path,
String localFilePath,
String comment,
boolean createParentFolders)
Create an unversioned file in the repository. |
RepositoryFolder |
createFolder(String path,
boolean createParentFolder)
Create a container at the given location in the repository. |
RepositoryFile |
createVersionedFile(String path,
String localFilePath,
String comment,
String startingVersion,
boolean createParentFolders)
Create a versioned file in the repository. |
void |
delete(String path)
Logically delete the specified resource (i.e. |
RepositoryFile |
disableVersioningOnFile(String path,
String comment)
Disable versioning support for the specified RepositoryFile. |
void |
downloadFile(String path,
String versionLabel,
String outputFilePath)
Download the current contents of a specified ServerResource to the specified local file. |
RepositoryFile |
enableVersioningOnFile(String path,
String comment,
String startingVersion)
Turn on versioning support for the specified RepositoryFile. |
boolean |
exists(String path)
Does the specified resource exist in the repository? |
List<RepositoryResource> |
getChildren(String parent)
Return the children of the specified resource. |
void |
getCurrentFileVersionToWorkspace(String path)
Get the current version of the specified repository file and bring it into your workspace. |
RepositoryFile |
getFileVersion(String path,
String versionLabel)
Get a client representation of the specified resource. |
void |
getFileVersionToWorkspace(String path,
String versionLabel)
Get the specified version of the repository file and bring it into your workspace. |
RepositoryResource |
getResource(String path)
Get a client representation of the specified repository resource. |
List<String> |
getVersionLabels(String path)
Get the list of labels for each version of the specified repository file stored in the repository. |
List<RepositoryFile> |
getVersions(String path)
Get the list of stored versions of the specified repository file. |
void |
markForAddAndCheckinFileFromWorkspace(String path,
boolean versionFile,
ResourceCheckinSpecification checkinSpecification)
Marks a file for add and checks it in to the repository from the workspace. |
RepositoryResource |
rename(String path,
String name)
Rename the repository resource. |
void |
undoCheckout(String path)
Undo the checkout of the specified resource so others can check out and modify that resource. |
void |
updateContentInWorkspaceAndCheckin(String path,
String localFilePath,
ResourceCheckinSpecification ciSpec)
Save the local file contents specified into the current user's workspace, and then check the workspace file into the repository. |
RepositoryFile |
updateFileContents(String path,
ResourceCheckinSpecification ciSpec,
String localFileLocation)
Replace the contents of a RepositoryFile with the provided content and make the new version number be as specified. |
Method Detail |
---|
void checkinFileFromWorkspace(String path, ResourceCheckinSpecification checkinSpecification) throws RepositoryResourceCheckinException, RepositoryResourceNotFoundException
path
- The file to be checked into the repository.checkinSpecification
- The specification of how the new version should be labeled.
RepositoryResourceCheckinException
- Thrown when the specified resource was not checked out.
RepositoryResourceNotFoundException
- Thrown if the specified resource does not exist in the repository.
If NULL is specified for checkinSpecification, that will be interpreted as a blank comment (and MINOR version update value if the file is versioned).
void markForAddAndCheckinFileFromWorkspace(String path, boolean versionFile, ResourceCheckinSpecification checkinSpecification) throws RepositoryResourceCheckinException, ResourceNotFoundException, MarkForAddException
path
- Path of file to be marked for add and checked in to the repository. Only file paths are supported.checkinSpecification
- The specification of how the new file should be checked in.versionFile
- Whether to version the file in the repository. If false, the version information on the checkinSpecification will be ignored,
however, the comment will be added, if provided.
RepositoryResourceCheckinException
- Thrown when the specified resource was could not be checked in.
ResourceNotFoundException
- Thrown when the specified path cannot be found.
MarkForAddException
- Thrown when the specified path cannot be marked for add.void checkoutFileToWorkspace(String path) throws RepositoryResourceCheckoutException, RepositoryResourceNotFoundException
path
- The repository file to be checked out.
RepositoryResourceNotFoundException
- The specified resource could not be found in the repository.
RepositoryResourceCheckoutException
- The resource was already checked out or locked from change.void checkoutFileToWorkspaceAndDownload(String path, String localFilePath) throws RepositoryResourceNotFoundException, RepositoryResourceCheckoutException, WorkspaceResourceNotFoundException, IOException
path
- The repository file to be checked out.localFilePath
- The path of the local file to write the content of the resource.
RepositoryResourceNotFoundException
- The resource was not found at the specified location.
RepositoryResourceCheckoutException
- The resource could not be checked out (is it already checked out by another user?)
WorkspaceResourceNotFoundException
- Resource was checked out but was not found in workspace for download as expected.
IOException
RepositoryResource copy(String sourcePath, String destinationPath) throws RepositoryResourceNotFoundException, RepositoryResourceExistsException, RepositoryResourceCopyException
sourcePath
- The path of the file or folder to copy.destinationPath
- The folder to put the new copy into.
RepositoryResourceNotFoundException
- The specified source resource was not found.
RepositoryResourceExistsException
- A resource already exists at the destination.
RepositoryResourceCopyException
- The copy request is not possible - typically the destination path was a child of the source path.RepositoryFolder createFolder(String path, boolean createParentFolder) throws RepositoryResourceNotFoundException, RepositoryResourceExistsException
path
- The path of the container to create.createParentFolder
- Flag indicating if missing parent containers should be automatically created during this operation.
RepositoryResourceNotFoundException
- Thrown if createParentContainers is set to false and an expected parent container does NOT exist.
RepositoryResourceExistsException
- Thrown if the requested container already exists in the repository.RepositoryFile createFile(String path, String localFilePath, String comment, boolean createParentFolders) throws RepositoryResourceNotFoundException, RepositoryResourceExistsException, IOException
path
- The location and name of the ServerResource to be created.localFilePath
- The local file with the contents for the new repository file..comment
- Comment about this newly-created unversioned file.createParentFolders
- Flag indicating if missing parent containers should be automatically created during this operation.
RepositoryResourceNotFoundException
- Thrown if you did not specify createParentFolders=true, and one of the parent containers specified for this new resource does not already exist.
RepositoryResourceExistsException
- Thrown if a file already exists at the specified path.
IOException
RepositoryFile createVersionedFile(String path, String localFilePath, String comment, String startingVersion, boolean createParentFolders) throws RepositoryResourceNotFoundException, RepositoryResourceExistsException, IOException
path
- The location and name of the ServerResource to be created.localFilePath
- The local file with the contents for the new WorkspaceFile.comment
- Comment about this newly created unversioned file.startingVersion
- The initial version label for this file.createParentFolders
- Flag indicating if missing parent containers should be automatically created during this operation.
RepositoryResourceNotFoundException
- Thrown if you did not specify createParentFolders=true, and one of the parent containers specified for this new resource does not already exist.
RepositoryResourceExistsException
- Throw if a file already exists at the specified path.
IOException
RepositoryFile disableVersioningOnFile(String path, String comment) throws RepositoryResourceNotFoundException, RepositoryResourceVersioningException
path
- The resource to be modifiedcomment
- Comment about this change.
RepositoryResourceNotFoundException
- The resource was not found at the specified location.
RepositoryResourceVersioningException
- Versioning could not be disabled for this resource (is the resource actually versioned?)
IllegalArgumentException
- If path provided is to a container.void downloadFile(String path, String versionLabel, String outputFilePath) throws RepositoryResourceNotFoundException, IOException
path
- The repository file you wish to download.versionLabel
- The version of the file you wish, blank if you want the latest version.outputFilePath
- The location you would like the resource contents to be placed.
RepositoryResourceNotFoundException
- The specified resource was not found at that location.
IOException
- Note this has no effect upon your workspace contents.void delete(String path) throws RepositoryResourceNotFoundException, RepositoryResourceDeleteException
path
- The resource to be deleted from the repository.
RepositoryResourceNotFoundException
- RepositoryResource was not found.
RepositoryResourceDeleteException
- RepositoryResource could TCommonnot be deleted.RepositoryFile enableVersioningOnFile(String path, String comment, String startingVersion) throws RepositoryResourceNotFoundException, RepositoryResourceVersioningException
path
- The repository file to be modifiedcomment
- Comment about this change.startingVersion
- The version label to use for the initial version of this repository file.
RepositoryResourceNotFoundException
- The resource was not found at the specified location.
RepositoryResourceVersioningException
- Versioning could not be enabled for this resource (is the resource already versioned?)boolean exists(String path)
path
- The path of the repository resource.
List<RepositoryResource> getChildren(String parent) throws RepositoryResourceNotFoundException
parent
- The parent repositoryContainer.
RepositoryResourceNotFoundException
- Thrown if the parent resource is not found in the repository.RepositoryResource getResource(String path) throws RepositoryResourceNotFoundException
path
- The path of the desired resource.
RepositoryResourceNotFoundException
- Thrown when a repository resource was not found at the given path.RepositoryFile getFileVersion(String path, String versionLabel) throws RepositoryResourceNotFoundException
path
- The path of the desired resource.versionLabel
- The desired version of that resource.
RepositoryResourceNotFoundException
- Thrown if a resource is not found at that location, or if the specified version label does not exist for that resource.List<String> getVersionLabels(String path) throws RepositoryResourceNotFoundException, RepositoryResourceVersioningException
path
- The repository file.
RepositoryResourceNotFoundException
- Repository file was not found at the given path.
RepositoryResourceVersioningException
- Repository file at the specified path is not versioned.List<RepositoryFile> getVersions(String path) throws RepositoryResourceNotFoundException, RepositoryResourceVersioningException
path
- The repository file.
RepositoryResourceNotFoundException
- Repository file was not found at the given path.
RepositoryResourceVersioningException
- The repository file is not versioned.void getCurrentFileVersionToWorkspace(String path) throws RepositoryResourceNotFoundException, WorkspaceResourceNotFoundException, IOException
path
- The path of the repository file.
RepositoryResourceNotFoundException
- Repository file was not found at the given path.
WorkspaceResourceNotFoundException
- See exception text.
IOException
- See exception text.void getFileVersionToWorkspace(String path, String versionLabel) throws RepositoryResourceNotFoundException, WorkspaceResourceNotFoundException, IOException
path
- The path of the repository file.versionLabel
- The label of the specific version that should be brought into your workspace.
RepositoryResourceNotFoundException
- Repository file was not found at the given path.
WorkspaceResourceNotFoundException
- See exception text.
IOException
- See exception text.RepositoryFile updateFileContents(String path, ResourceCheckinSpecification ciSpec, String localFileLocation) throws RepositoryResourceNotFoundException, IOException, RepositoryResourceVersioningException, RepositoryResourceCheckoutException
path
- The repository file to be modified.ciSpec
- Specification of how the RepositoryFile version number should be modified (if the file is versioned)..localFileLocation
- The local file with the contents of the new version of the RepositoryFile.
RepositoryResourceNotFoundException
- The repository file was not found at the specified location.
IOException
- See the exception text.
RepositoryResourceVersioningException
- The provided version specification was illegal or inappropriate for the specified file.
RepositoryResourceCheckoutException
- The repository file specified is currently checked out.
Note: This method allows the direct updating of a repository file without going through the typical checkout/checkin process, and has no effect upon your workspace contents.
If NULL is specified for checkinSpecification, that will be interpreted as a blank comment (and MINOR version update value if the file is versioned).
void undoCheckout(String path) throws RepositoryResourceUndoCheckoutException
path
- The repository file being released.
RepositoryResourceUndoCheckoutException
- Thrown if the repository file was not checked out.void updateContentInWorkspaceAndCheckin(String path, String localFilePath, ResourceCheckinSpecification ciSpec) throws RepositoryResourceNotFoundException, RepositoryResourceVersioningException, RepositoryResourceCheckoutException, IOException, RepositoryResourceCheckinException
path
- The file to be updated in your workspace by local content and then checked into the repository.localFilePath
- The path of the local file from which the new contents of the resource are to be read.ciSpec
- Specification of how the RepositoryFile version number should be modified.
RepositoryResourceNotFoundException
- The resource was not found at the specified path.
RepositoryResourceVersioningException
- The specified new version label would be illegal.
RepositoryResourceCheckoutException
- The resource was not checked out.
IOException
- See the exception text.
RepositoryResourceCheckinException
- See the exception text.RepositoryResource rename(String path, String name) throws RepositoryResourceNotFoundException, RepositoryResourceExistsException, RepositoryResourceRenameException
path
- The path of the repository resource to rename.name
- The new name
RepositoryResourceNotFoundException
- A resource was not found at the specified location.
RepositoryResourceExistsException
- A resource already exists in the targetFolder with the name newName.
RepositoryResourceRenameException
- The specified resource could not be renamed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |