Interface RepositoryService
-
public interface RepositoryService
A service to manage resources in the repository.A repository file is typically modified by checking it out into a user's workspace, modifying the file in the workspace, and then checking the modified files into the repository.
The repository file can be versioned or unversioned.
When an unversioned file is updated, its content is replaced by the new content. When a versioned file is updated, a new version of the file is created with the new version number that is specified by
RepositoryCheckinSpecification
. RepositoryCheckinSpecification specifies that the major or minor number field is incremented or specifies the exact version label to use for the update. New version number must always be an increase of the previous number.- Since:
- 1.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RepositoryFile
checkin(java.lang.String path, RepositoryCheckinSpecification checkinSpecification)
Checks in the file from the current user's workspace to the repository.RepositoryFile
checkout(java.lang.String path)
Checks out the file from the repository.void
clearCheckedOutFilesSearchResults()
Releases any cached information about the query that is associated with the current search.RepositoryItem
copy(java.lang.String sourcePath, java.lang.String destinationPath)
Copies the repository object from the source path to the destination path.void
copyLatestFileVersionToWorkspace(java.lang.String path)
Copies the latest version of the repository file to your workspace.void
copySpecificFileVersionToWorkspace(java.lang.String path, java.lang.String version)
Copies the version of the repository file to your workspace.RepositoryContext
createContext(java.lang.String path, java.lang.String typeId)
Creates a context in the repository.RepositoryFile
createFile(java.lang.String path, java.lang.String localFilePath, java.lang.String comment, boolean createParentFolders)
Creates an unversioned file in the repository.RepositoryFolder
createFolder(java.lang.String path, boolean createParentFolders)
Creates a folder in the repository.RepositorySharedFolder
createSharedFolder(java.lang.String path)
Creates a shared folder in the repository.RepositoryFile
createVersionedFile(java.lang.String path, java.lang.String localFilePath, java.lang.String comment, java.lang.String startingVersion, boolean createParentFolders)
Creates a versioned file in the repository.java.util.List<java.lang.String>
delete(java.lang.String path)
Logically deletes the object (moves it to the recycle bin).java.util.List<VersionDeleteInfo>
deleteVersions(java.lang.String path, java.util.Set<java.lang.String> versions)
Permanently deletes the versions of the file at the specified path.RepositoryFile
disableVersioning(java.lang.String path, java.lang.String comment)
Disables versioning support for the repository file.void
downloadFile(java.lang.String path, java.lang.String version, java.lang.String outputFilePath)
Downloads the file to a local file.RepositoryFile
enableVersioning(java.lang.String path, java.lang.String startingVersion, java.lang.String comment)
Enables versioning for the repository file.boolean
exists(java.lang.String path)
Indicates whether the path exists in the repository.java.util.List<SynchronizationInfo>
getCheckedOutFilesSearchResults(int fromRow, int toRow)
Gets a range of results after callingsearchCheckedOutFiles(CheckedOutFilesQuery)
.java.util.List<RepositoryItem>
getChildren(java.lang.String path)
Gets the children of the container path.java.util.List<RepositoryItem>
getChildrenByType(java.lang.String path, java.lang.String typeId)
Gets the children of the container path.RepositoryContext
getContext(java.lang.String path)
Gets the repository context at the path.RepositoryContext
getContextById(java.lang.String id)
Gets the repository context by its unique identifier.RepositoryFile
getFile(java.lang.String path)
Gets the repository file at the path.RepositoryFile
getFileVersion(java.lang.String path, java.lang.String version)
Gets the specific version of a versioned file.java.util.List<RepositoryFileVersionInfo>
getFileVersionInfos(java.lang.String path)
Gets the list of the version information that represents each version of the repository file.java.util.List<RepositoryFile>
getFileVersions(java.lang.String path)
Gets the list of versions of the repository file.RepositoryFolder
getFolder(java.lang.String path)
Gets the repository folder at the path.RepositoryItem
getItem(java.lang.String path)
Gets the repository object at the path.int
getPageSizeLimit()
Gets the maximum number of checked out files that can be returned in a single request.RepositoryContext
getParentMembershipContext(java.lang.String path)
Gets the nearest parent context with the membership capability for the repository path.SynchronizationInfo
getSynchronizationInfo(java.lang.String path)
Gets the synchronization information for the specified file path.java.util.List<SynchronizationInfo>
getSynchronizationInfos(java.util.Set<java.lang.String> paths, boolean recurse)
Gets the synchronization information for the paths specified.RepositoryContext
getTopLevelContextByName(java.lang.String name)
Gets a top-level context by name.java.util.List<RepositoryContext>
getTopLevelContexts()
Gets the list of all of the accessible top-level contexts.RepositoryFile
lockFile(java.lang.String path)
Locks the specified repository file, prevents users from modifying the file in any way.RepositoryItem
move(java.lang.String sourcePath, java.lang.String destinationPath)
Moves the repository object from the source path to the destination path.java.util.List<java.lang.String>
permanentlyDelete(java.lang.String path)
Permanently deletes the specified object.RepositoryItem
rename(java.lang.String path, java.lang.String name)
Renames the repository object.RepositorySearchResults
search(SearchQuery query)
Searches the repository based on the specified query.SearchResultsInfo
searchCheckedOutFiles(CheckedOutFilesQuery query)
Searches the checked out files information and returns the information that describes the results, not the results themselves.java.util.List<RepositoryStateChangeResult>
setState(java.lang.String path, RepositoryItem.State state, java.lang.String comment, boolean recurse)
Sets the state of a repository context.RepositoryFile
undoCheckout(java.lang.String path)
Undoes the checkout of the file.RepositoryFile
unlockFile(java.lang.String path)
Unlocks the repository file.RepositoryFile
updateFileContents(java.lang.String path, RepositoryCheckinSpecification checkinSpecification, java.lang.String localFileLocation)
Updates the repository file with the specified file or creates a new version of the file, if the file is versioned.RepositoryItem
updateItem(RepositoryItem item)
Updates the editable attributes of a repository object.
-
-
-
Method Detail
-
createContext
RepositoryContext createContext(java.lang.String path, java.lang.String typeId) throws RepositoryItemNotFoundException, RepositoryItemExistsException
Creates a context in the repository.- Parameters:
path
- The path to the context to create.typeId
- The type of context to create.- Returns:
- The created context.
- Throws:
RepositoryItemNotFoundException
- Thrown when a parent context does NOT exist.RepositoryItemExistsException
- Thrown when an object exists in the repository at the specified path.
-
createFolder
RepositoryFolder createFolder(java.lang.String path, boolean createParentFolders) throws RepositoryItemNotFoundException, RepositoryItemExistsException
Creates a folder in the repository.- Parameters:
path
- The path to the folder to create.createParentFolders
- Indicates whether the parent folders are automatically created during the operation. This does NOT include creating contexts, only folders.- Returns:
- The created folder.
- Throws:
RepositoryItemNotFoundException
- Thrown whencreateParentContainers
is set tofalse
and a parent container does NOT exist.RepositoryItemExistsException
- Thrown when an object exists in the repository at the specified path.
-
createSharedFolder
RepositorySharedFolder createSharedFolder(java.lang.String path) throws RepositoryItemNotFoundException, RepositoryItemExistsException
Creates a shared folder in the repository. The folder must be directly under a context that has the capability to have files and folders. There cannot already be a shared folder under the same context because only one shared folder can exist in a context.Creating a shared folder requires the privilege
ScopedPrivileges.PRIVILEGE_MANAGE_SHARED_FOLDERS
.- Parameters:
path
- The path to the shared folder to create.- Returns:
- The created shared folder.
- Throws:
RepositoryItemNotFoundException
- Thrown when the parent container does not exist.RepositoryItemExistsException
- Thrown when a shared folder already exists under the context.
-
createFile
RepositoryFile createFile(java.lang.String path, java.lang.String localFilePath, java.lang.String comment, boolean createParentFolders) throws RepositoryItemNotFoundException, RepositoryItemExistsException, java.io.IOException
Creates an unversioned file in the repository.- Parameters:
path
- The path to the unversioned file.localFilePath
- The local file path with the contents for the new repository file.comment
- The comment about the unversioned file.createParentFolders
- Indicates whether the missing parent containers are automatically created during the operation. This does NOT include creating contexts, only folders.- Returns:
- The created unversioned repository file.
- Throws:
RepositoryItemNotFoundException
- Thrown whencreateParentContainers
is set tofalse
and a parent container does NOT exist.RepositoryItemExistsException
- Thrown when an object exists at the specified path.java.io.IOException
- Thrown when there is a problem streaming the file contents.
-
createVersionedFile
RepositoryFile createVersionedFile(java.lang.String path, java.lang.String localFilePath, java.lang.String comment, java.lang.String startingVersion, boolean createParentFolders) throws RepositoryItemNotFoundException, RepositoryItemExistsException, java.io.IOException
Creates a versioned file in the repository.- Parameters:
path
- The path to the versioned file.localFilePath
- The local file path with the contents for the new repository file.comment
- The comment about the versioned file.startingVersion
- The version to use for the initial version of the repository file. The default version of1.0
is used if not provided.createParentFolders
- Indicates whether missing parent containers are automatically created during the operation. This does NOT include creating contexts, only folders.- Returns:
- The created versioned repository file.
- Throws:
RepositoryItemNotFoundException
- Thrown whencreateParentFolders
isfalse
and a parent container does NOT exist.RepositoryItemExistsException
- Thrown when an object exists at the specified path.java.io.IOException
- Thrown when there is a problem streaming the file contents.
-
updateItem
RepositoryItem updateItem(RepositoryItem item) throws RepositoryItemNotFoundException, RepositoryItemUpdateException
Updates the editable attributes of a repository object. These include description, the syncable flag, the run-as-owner flag (if the object is a job file), and extended attributes, if they exist. All other attribute changes are ignored. If any extended attributes are deleted, or new attributes added that are not defined for the object type, those changes are ignored.The expected flow for the call is to first retrieve the object by calling
getItem(String)
orgetChildren(String)
, making required updates to the editable attributes, and then calling this method to persist the changes.- Parameters:
item
- The repository object.- Returns:
- The updated repository object.
- Throws:
RepositoryItemNotFoundException
- Thrown when repository object is not found at the given path.RepositoryItemUpdateException
- Thrown when the repository object is not updated.- Since:
- 1.7
-
rename
RepositoryItem rename(java.lang.String path, java.lang.String name) throws RepositoryItemNotFoundException, RepositoryItemExistsException
Renames the repository object.- Parameters:
path
- The path to the repository object to rename.name
- the new name- Returns:
- The updated repository object with the new name.
- Throws:
RepositoryItemNotFoundException
- Thrown when repository object was not found at the specified path.RepositoryItemExistsException
- Thrown when a repository object exists in the same location with the new. name.
-
move
RepositoryItem move(java.lang.String sourcePath, java.lang.String destinationPath) throws RepositoryItemNotFoundException, RepositoryItemExistsException, RepositoryItemMoveException
Moves the repository object from the source path to the destination path. The destination path is the full path to the moved item, which includes the name of the moved object.Only folders and files can be moved. Objects that are moved maintain their identifiers and their audit trail.
- Parameters:
sourcePath
- The path to the file or folder.destinationPath
- The path to the destination file or folder, which includes the name of the item.- Returns:
- The moved repository object.
- Throws:
RepositoryItemNotFoundException
- Thrown when the specified source path or destination location is not found.RepositoryItemExistsException
- Thrown when an object exists at the destination path.RepositoryItemMoveException
- Thrown when the move request is not possible.
-
copy
RepositoryItem copy(java.lang.String sourcePath, java.lang.String destinationPath) throws RepositoryItemNotFoundException, RepositoryItemExistsException, RepositoryItemCopyException
Copies the repository object from the source path to the destination path. The destination path is the full path to the created copy, which includes the name of the new object.Only folders and files can be copied. Items that are copied create new items, with new identifiers. If a folder is copied, the folder and all readable contents within it are copied. If a versioned file is copied, only the latest version of the file is copied.
- Parameters:
sourcePath
- The path to the file or folder to copy.destinationPath
- The path to the destination file or folder to create, which includes the name of the created copy.- Returns:
- The created repository file or folder.
- Throws:
RepositoryItemNotFoundException
- Thrown when the specified source path or destination location is not found.RepositoryItemExistsException
- Whrown when an object exists at the destination path.RepositoryItemCopyException
- Thrown when the copy request is not possible. For example, the destination path is a child of the source path.
-
delete
java.util.List<java.lang.String> delete(java.lang.String path) throws RepositoryItemNotFoundException, RepositoryItemDeleteException
Logically deletes the object (moves it to the recycle bin). Only files and folders can be logically deleted. Note that contexts cannot be logically or permanently deleted via the API.- Parameters:
path
- The object to logically delete.- Returns:
- The list of the paths that were logically deleted with the action.
- Throws:
RepositoryItemNotFoundException
- Thrown when repository object is not found at the given path.RepositoryItemDeleteException
- Thrown when there is an issue logically deleting the object.
-
deleteVersions
java.util.List<VersionDeleteInfo> deleteVersions(java.lang.String path, java.util.Set<java.lang.String> versions) throws RepositoryItemNotFoundException, RepositoryItemDeleteException
Permanently deletes the versions of the file at the specified path.- Parameters:
path
- The path to the file with versions.versions
- The versions of the path to delete.- Returns:
- The list of deletion status information for each version that is specified for deletion.
- Throws:
RepositoryItemNotFoundException
- Thrown when repository object is not found at the specified path.RepositoryItemDeleteException
- Thrown when there is an issue permanently deleting the version.
-
permanentlyDelete
java.util.List<java.lang.String> permanentlyDelete(java.lang.String path) throws RepositoryItemNotFoundException, RepositoryItemDeleteException
Permanently deletes the specified object. This action cannot be undone. If the object is a file, all versions (if the file is versioned) are deleted. Contexts cannot be permanently deleted. If the object is a container, all children are deleted.- Parameters:
path
- The object to permanently delete.- Returns:
- The list of the paths that were permanently deleted with the action.
- Throws:
RepositoryItemNotFoundException
- Thrown when repository object is not found at the given path.RepositoryItemDeleteException
- Thrown when there is an issue permanently deleting the item.
-
enableVersioning
RepositoryFile enableVersioning(java.lang.String path, java.lang.String startingVersion, java.lang.String comment) throws RepositoryItemNotFoundException, RepositoryItemVersioningException
Enables versioning for the repository file. The current contents of the file are the starting version of the versioned file.- Parameters:
path
- The repository file to version.startingVersion
- (optional) the version to use for the initial version of the repository file. The default version of1.0
is used if not provided.comment
- (optional) a comment that describes the version.- Returns:
- The updated versioned file.
- Throws:
RepositoryItemNotFoundException
- Thrown when repository object is not found at the specified path.RepositoryItemVersioningException
- Thrown when the file versioning is not enabled, such as when the file currently versioned.
-
disableVersioning
RepositoryFile disableVersioning(java.lang.String path, java.lang.String comment) throws RepositoryItemNotFoundException, RepositoryItemVersioningException
Disables versioning support for the repository file. The latest version contents remain as the only contents available for the file. All previous versions of the file and their contents are removed. This action cannot be undone.- Parameters:
path
- The repository file to unversion.comment
- Thecomment that describes the file's contents.- Returns:
- The updated unversioned file.
- Throws:
RepositoryItemNotFoundException
- Thrown when the specified path is not found.RepositoryItemVersioningException
- Thrown when versioning is not disabled for the file, such as when the file is currently unversioned.
-
lockFile
RepositoryFile lockFile(java.lang.String path) throws RepositoryItemNotFoundException, RepositoryItemLockException
Locks the specified repository file, prevents users from modifying the file in any way.- Parameters:
path
- The path to the repository file to lock.- Returns:
- The locked repository file.
- Throws:
RepositoryItemNotFoundException
- Thrown when the specified path is not found.RepositoryItemLockException
- Thrown when the specified file is not locked, such as when the file is currently locked.
-
unlockFile
RepositoryFile unlockFile(java.lang.String path) throws RepositoryItemNotFoundException, RepositoryItemUnlockException
Unlocks the repository file.- Parameters:
path
- The path to the repository file to unlock.- Returns:
- The unlocked repository file.
- Throws:
RepositoryItemNotFoundException
- Thrown when the specified path is not found.RepositoryItemUnlockException
- Thrown when the specified file cannot be unlocked, such as when the file is currently unlocked.
-
exists
boolean exists(java.lang.String path)
Indicates whether the path exists in the repository.- Parameters:
path
- The path to the repository item.- Returns:
True
, if the path exists,false
otherwise.
-
getItem
RepositoryItem getItem(java.lang.String path) throws RepositoryItemNotFoundException
Gets the repository object at the path.- Parameters:
path
- The path to the repository item.- Returns:
- The repository object located at the specified path.
- Throws:
RepositoryItemNotFoundException
- Thrown when repository object is not found at the specified path.
-
getTopLevelContextByName
RepositoryContext getTopLevelContextByName(java.lang.String name) throws RepositoryItemNotFoundException
Gets a top-level context by name.- Parameters:
name
- The name of the top-level context.- Returns:
- The top-level context with the specified name.
- Throws:
RepositoryItemNotFoundException
- Thrown when the top-level context is not found.
-
getTopLevelContexts
java.util.List<RepositoryContext> getTopLevelContexts()
Gets the list of all of the accessible top-level contexts.- Returns:
- The list of all of the accessible top-level contexts.
-
getSynchronizationInfo
SynchronizationInfo getSynchronizationInfo(java.lang.String path)
Gets the synchronization information for the specified file path.The synchronization information is information about the state between the file that that is located in the workspace and a file that is located in the repository. A file that is in the workspace can be independent of a file that is in the repository. This method retrieves information which that indicates the
state
of the file. Does it exist only in the workspace or the repository? Does it exist in both places? Was the workspace file synchronized with the repository file? If so, which version of the repository file was synchronized? Is the workspace file still in sync with the repository file or has the repository file changed? Has the workspace file changed?The information contained in the
SynchronizationInfo
object enables you to determine whether the workspace file is out-of-sync with the repository file.If the path specified does not exist a
SynchronizationInfo
is returned,SynchronizationInfo.FileStatus.NON_EXISTENT
is set, and all other file information attributes are null. If the path is to a folder, anIllegalArgumentException
is thrown.- Parameters:
path
- The file path to retrieve synchronization information for.- Returns:
- The synchronization information for the file.
-
getSynchronizationInfos
java.util.List<SynchronizationInfo> getSynchronizationInfos(java.util.Set<java.lang.String> paths, boolean recurse)
Gets the synchronization information for the paths specified. The paths can be to files or folders. For a folder path, if recurse is false, synchronization information for the files immediately within the folder are returned. If recurse is true, it returns synchronization information for all of the files that are within the entire subtree.If there are no child files, then an empty
List
is be returned. Note: Root and top context level paths are not allowed.- Parameters:
paths
- That path to the files or folders.recurse
- Indicates whether to retrieve recursive synchronization. Iffalse
, it retrieves the synchronization information for the files that are within the folder specified (the folder's immediate children). Iftrue
, it retrieves the synchronization information for the files that are within the entire subtree (recurses into all subfolders, if they exist).- Returns:
- The synchronization information for files at the specified paths.
-
getContext
RepositoryContext getContext(java.lang.String path) throws RepositoryItemNotFoundException
Gets the repository context at the path.- Parameters:
path
- The path to the repository context.- Returns:
- The repository context located at the specified path.
- Throws:
RepositoryItemNotFoundException
- Thrown when a repository context is not found at the specified path.
-
getContextById
RepositoryContext getContextById(java.lang.String id) throws RepositoryItemNotFoundException
Gets the repository context by its unique identifier.- Parameters:
id
- The identifier of the repository context.- Returns:
- The repository context that is located at the specified path.
- Throws:
RepositoryItemNotFoundException
- Thrown when a repository context is not found.
-
getParentMembershipContext
RepositoryContext getParentMembershipContext(java.lang.String path) throws RepositoryItemNotFoundException, MembershipContextNotFoundException
Gets the nearest parent context with the membership capability for the repository path. Read access is required to the context that is returned.- Parameters:
path
- The repository path for which the nearest membership context is found. This can be a folder path, file path, context path, or other repository type.- Returns:
- The nearest repository context with the membership capability.
- Throws:
RepositoryItemNotFoundException
- Thrown when the repository item is not found at the specified path.MembershipContextNotFoundException
- Thrown when the repository item has no parent context with the membership capability. This is thrown when a top repository context path is specified.
-
getFolder
RepositoryFolder getFolder(java.lang.String path) throws RepositoryItemNotFoundException
Gets the repository folder at the path.- Parameters:
path
- The path to the repository folder.- Returns:
- The repository folder located at the specified path.
- Throws:
RepositoryItemNotFoundException
- Thrown when the repository folder is not found at the specified path.
-
getFile
RepositoryFile getFile(java.lang.String path) throws RepositoryItemNotFoundException
Gets the repository file at the path.- Parameters:
path
- the path of the repository file.- Returns:
- The repository file that is located at the specified path.
- Throws:
RepositoryItemNotFoundException
- Thrown when the repository file is not found at the specified path.
-
getChildren
java.util.List<RepositoryItem> getChildren(java.lang.String path) throws RepositoryItemNotFoundException
Gets the children of the container path.- Parameters:
path
- The path to the parent container.- Returns:
- The children of the parent container.
- Throws:
RepositoryItemNotFoundException
- Thrown when the repository item is not found at the specified path.
-
getChildrenByType
java.util.List<RepositoryItem> getChildrenByType(java.lang.String path, java.lang.String typeId) throws RepositoryItemNotFoundException
Gets the children of the container path.- Parameters:
path
- The path to the parent container.typeId
- The type of children to return.- Returns:
- The children of the parent container.
- Throws:
RepositoryItemNotFoundException
- Thrown when the repository item is not found at the specified path.
-
getFileVersion
RepositoryFile getFileVersion(java.lang.String path, java.lang.String version) throws RepositoryItemNotFoundException
Gets the specific version of a versioned file.- Parameters:
path
- The path to the versioned file.version
- The version.- Returns:
- The specified version of the versioned file at the specified path.
- Throws:
RepositoryItemNotFoundException
- Thrown when the repository item is not found at the specified path, if it is not a versioned file, or if the specified version does not exist for the versioned file.
-
getFileVersions
java.util.List<RepositoryFile> getFileVersions(java.lang.String path) throws RepositoryItemNotFoundException, RepositoryItemVersioningException
Gets the list of versions of the repository file.- Parameters:
path
- The path to the file.- Returns:
- The list of the repository files, one for each version of the specified file that is in the repository.
- Throws:
RepositoryItemNotFoundException
- Thrown when the repository item is not found at the specified path.RepositoryItemVersioningException
- Thrown when the file at the specified path is not versioned.
-
getFileVersionInfos
java.util.List<RepositoryFileVersionInfo> getFileVersionInfos(java.lang.String path) throws RepositoryItemNotFoundException, RepositoryItemVersioningException
Gets the list of the version information that represents each version of the repository file.- Parameters:
path
- The path to the repository file.- Returns:
- A list of the version information that describes each version of the specified file.
- Throws:
RepositoryItemNotFoundException
- Thrown when the repository item is not found at the specified path.RepositoryItemVersioningException
- Thrown when the file at the specified path is not versioned.
-
downloadFile
void downloadFile(java.lang.String path, java.lang.String version, java.lang.String outputFilePath) throws RepositoryItemNotFoundException, java.io.IOException
Downloads the file to a local file.Note: This action has no effect upon the workspace. The file is downloaded to the client computer.
- Parameters:
path
- The path to the repository file to download.version
- The version of the file to download. Specify null if you want the latest version.outputFilePath
- The location on the client computer in which to store the file.- Throws:
RepositoryItemNotFoundException
- Thrown when the repository item is not found at the specified path.java.io.IOException
- Thrown when there is a problem streaming the file.
-
updateFileContents
RepositoryFile updateFileContents(java.lang.String path, RepositoryCheckinSpecification checkinSpecification, java.lang.String localFileLocation) throws RepositoryItemNotFoundException, RepositoryItemVersioningException, RepositoryItemCheckoutException, java.io.IOException
Updates the repository file with the specified file or creates a new version of the file, if the file is versioned.Note: This method enables you to update a repository file without going through the typical checkout/checkin process. Therefore, this action has no effect on your workspace contents.
If
null
is specified for the checkin specification, that is interpreted as a blank comment andMAJOR
version update value, if the file is versioned.- Parameters:
path
- The path to the repository file to update.checkinSpecification
- The method to generate the file version number, if the file is versioned.localFileLocation
- The local file path with the new version of the file.- Returns:
- The modified repository file.
- Throws:
RepositoryItemNotFoundException
- Thrown when the repository item is not found at the specified path.RepositoryItemVersioningException
- Thrown when the version specification is not valid or inappropriate for the specified file.RepositoryItemCheckoutException
- Thrown when the specified file specified is currently checked out.java.io.IOException
- Thrown when there is a problem streaming the file.
-
setState
java.util.List<RepositoryStateChangeResult> setState(java.lang.String path, RepositoryItem.State state, java.lang.String comment, boolean recurse) throws RepositoryItemNotFoundException
Sets the state of a repository context. These are the twoRepositoryItem.State
s:- ACTIVE - Allows all repository activities that authorizations allow.
- CLOSED - Prevents all actions that could change the content or metadata. CLOSED is intended to be an archival state that prevents all changes to the current structure and data.
Setting the state requires the privilege
PRIVILEGE_MANAGE_STATE
. In addition,READ METADATA
andWRITE METADATA
permissions are required on the context. If the user setting the state has these authorizations, then they are allowed to set the state on all descendents implicitly. Even if they lack one or both of the permissions required on the context to set, the state IS set implicitly, if the state is cascading.As described above, an ACTIVE context within a CLOSED context is an invalid state. Therefore, when setting a context from CLOSED to ACTIVE and the parent context is CLOSED, this action automatically changes the state of all immediate ancestors that are CLOSED to ACTIVE.
- Parameters:
path
- The path to the context.state
- The state.comment
- The comment that is used in the audit record. If no comment is specified then that value is not audited. The comment is not persisted in any other place except the audit trail.recurse
- The state to set is cascaded to all of the descendent contexts. All non-context descendents (which includes non-stateable) contexts are always set regardless of whether this flag is set. If a context is set to ACTIVE, all folders, files, and non-stateable context descendents are set to the context state automatically by default. The flag indicates whether stateable context descendents should have their state changed. The flag is used only when setting the state to ACTIVE. When setting a context state to CLOSED, then ALL descendents are automatically set to CLOSED because ACTIVE content within a CLOSED context is an invalid state. Therefore, when closing a context, the flag is ignored because recursion is a requirement.- Returns:
- The results of what changed based on the action.
- Throws:
RepositoryItemNotFoundException
- Thrown when the item no longer exists.IllegalTypeException
- Thrown if the path specified is for a type that is notStateable
. This includes non-stateable context types, folders, and files.PrivilegeRequiredAccessDeniedException
- Thrown when the current user does not have the scoped privilegePRIVILEGE_MANAGE_STATE
granted at the context to be set or higher. This can also be thrown when the user is propagating the state change upwards and they do NOT have the privilege on a parent.PermissionRequiredAccessDeniedException
- Thrown when the current user does not haveREAD
andWRITE METADATA
permissions on the context to set. This can also be thrown when the user is propagating the state change upwards and they do NOT have the permissions on a parent.
-
checkout
RepositoryFile checkout(java.lang.String path) throws RepositoryItemNotFoundException, RepositoryItemCheckoutException
Checks out the file from the repository.- Parameters:
path
- The repository file.- Returns:
- The repository file in a checked out state.
- Throws:
RepositoryItemNotFoundException
- Thrown when the specified path is not found.RepositoryItemCheckoutException
- Thrown when the file is currently checked out or locked.
-
undoCheckout
RepositoryFile undoCheckout(java.lang.String path) throws RepositoryItemNotFoundException, RepositoryItemUndoCheckoutException
Undoes the checkout of the file.- Parameters:
path
- The repository file.- Returns:
- The repository file in an unchecked out state.
- Throws:
RepositoryItemNotFoundException
- Thrown when the specified path cannot not found.RepositoryItemUndoCheckoutException
- Thrown when the repository file is not checked out.
-
checkin
RepositoryFile checkin(java.lang.String path, RepositoryCheckinSpecification checkinSpecification) throws RepositoryItemNotFoundException, RepositoryItemCheckinException
Checks in the file from the current user's workspace to the repository.- Parameters:
path
- The file.checkinSpecification
- The method for how to label the new version. Ifnull
is specified for checkinSpecification, that is interpreted as a blank comment (and MINOR version update value if the file is versioned).- Returns:
- The latest version of the repository file.
- Throws:
RepositoryItemNotFoundException
- Thrown when the specified path is not found.RepositoryItemCheckinException
- Thrown when the specified file is not checked in.
-
copyLatestFileVersionToWorkspace
void copyLatestFileVersionToWorkspace(java.lang.String path) throws RepositoryItemNotFoundException
Copies the latest version of the repository file to your workspace.- Parameters:
path
- The path to the repository file.- Throws:
RepositoryItemNotFoundException
- Thrown when repository file is not found at the specified path.
-
copySpecificFileVersionToWorkspace
void copySpecificFileVersionToWorkspace(java.lang.String path, java.lang.String version) throws RepositoryItemNotFoundException
Copies the version of the repository file to your workspace.- Parameters:
path
- The path to the repository file.version
- The specific version to copy into your workspace.- Throws:
RepositoryItemNotFoundException
- Thrown when the repository file is not found at the specified path.
-
searchCheckedOutFiles
SearchResultsInfo searchCheckedOutFiles(CheckedOutFilesQuery query)
Searches the checked out files information and returns the information that describes the results, not the results themselves. The search results information contains the row count in which to request pageable checked-out file entries by callinggetCheckedOutFilesSearchResults(int, int)
. When the results are no longer required, callclearCheckedOutFilesSearchResults()
to release server-side resources that are related to the query.Note: Only one query can be active at a time for each client. The results generated for the query can be used to iterate through the results by calling
getCheckedOutFilesSearchResults(int, int)
, but if the same client calls this method again, a new set of results is generated. The previous results are no longer valid.- Parameters:
query
- The search criteria with which to query the checked out files. Specifying null returns the current user's checked out files.- Returns:
- The metadata that describes the search results that contains the row count to indicate the number of records that were returned by the query.
-
search
RepositorySearchResults search(SearchQuery query) throws RepositorySearchException
Searches the repository based on the specified query. The server will return a list ofRepositoryItem
s that satisfy the query. However, items in the recycle bin and any items that the current user does not have read access to will not be returned. If the server cannot process all of the items due to server limitations,RepositorySearchResults.isLimitReached()
is set totrue
. If true, more items might exist that satisfy the query but they cannot be returned.Search rules:
- Search is not case-sensitive. AAA finds file with aaa.
- Without quotes surrounding multiple-word search item, the search find each individual word, not the whole word phrase. For example, APPLE TARTE returns files with apple or tarte or both, whereas "APPLE TARTE" only returns files that contain the exact search item.
- Without * or ? wildcard characters, the search tooling will not find search terms contained inside other text. By default, it searches for complete words.
To search file content, setTypeId must be called with one of the following types. Note: Because job files contain XML content, search will only find what is in attribute values.
- Parameters:
query
- The search criteria with which to query the repository. Must specify a value for at least one query field.- Returns:
- The metadata that describes the search results that contains
RepositoryItem
s that satisfy the query and whether the limit is reached on the server. - Throws:
RepositorySearchException
- Thrown if there is an issue processing the repository search.
-
getCheckedOutFilesSearchResults
java.util.List<SynchronizationInfo> getCheckedOutFilesSearchResults(int fromRow, int toRow) throws CheckedOutFilesSearchException
Gets a range of results after callingsearchCheckedOutFiles(CheckedOutFilesQuery)
. Thefrom row
andto row
values must be between 1 and the total number of rows retrieved by the query. This is considered apage
of results, and therefore, apageable
results model.Note: The maximum number of records that can be returned for a single page is determined by
getPageSizeLimit()
. The default maximum is 5000.- Parameters:
fromRow
- The starting row number to include in the results. Must be greater than 0.toRow
- The ending row number to include in the results. Must be less than or equal to the total row count. The total number retrieved must be less than or equal to the page size limit.- Returns:
- The list of SynchronizationInfo objects that are based on token and rows specified.
- Throws:
CheckedOutFilesSearchException
- Thrown when the total row number requested exceeds the page size limit.
-
clearCheckedOutFilesSearchResults
void clearCheckedOutFilesSearchResults()
Releases any cached information about the query that is associated with the current search. This should be called once in afinally
block for each call tosearchCheckedOutFiles(CheckedOutFilesQuery)
. If the results no longer exist when this method is called, then this method returns without any further action.
-
getPageSizeLimit
int getPageSizeLimit()
Gets the maximum number of checked out files that can be returned in a single request. The default is 5000.- Returns:
- The page size limit.
-
-