public interface WorkspaceService
Modifier and Type | Method and Description |
---|---|
WorkspaceItem |
copy(String sourcePath,
String destinationPath)
Copies the workspace folder or file from the source path to the destination path.
|
WorkspaceFile |
createFile(String path,
String localFilePath,
boolean createParentFolders)
Creates a file in the workspace.
|
WorkspaceFolder |
createFolder(String path,
boolean createParentFolders)
Creates a folder in the workspace.
|
void |
delete(String path)
Delete the specified folder or file in the workspace.
|
void |
downloadFile(String path,
String outputFilePath)
Downloads the contents the workspace file to the specified local file system path.
|
boolean |
exists(String path)
Indicates whether the item exists in the workspace.
|
SynchronizationInfo.CheckoutStatus |
getCheckoutStatus(String path)
Gets an enumeration value that describes the
checkout status of the file. |
List<WorkspaceItem> |
getChildren(String path)
Gets the immediate children of the workspace folder.
|
WorkspaceItem |
getItem(String path)
Gets a client representation of the item in the workspace.
|
void |
markForAdd(String path)
Marks a file for addition to the repository.
|
WorkspaceItem |
move(String sourcePath,
String destinationPath)
Moves the workspace folder or file from one location to another.
|
WorkspaceItem |
rename(String path,
String name)
Renames the workspace folder or file.
|
WorkspaceFile |
updateFileContents(String path,
String localFilePath)
Replaces the content of the workspace file with the content of the specified local file system file.
|
WorkspaceFolder createFolder(String path, boolean createParentFolders) throws WorkspaceItemNotFoundException, WorkspaceItemExistsException
path
- the full path of the workspace folder to create.createParentFolders
- flag that indicates that missing parent folders are automatically created.WorkspaceItemNotFoundException
- thrown when createParentFolders
is set to False
and a parent
folder in the specified path does not exist.WorkspaceItemExistsException
- thrown when a folder or file exists at the specified path.WorkspaceFile createFile(String path, String localFilePath, boolean createParentFolders) throws WorkspaceItemNotFoundException, WorkspaceItemExistsException, IOException
Use updateFileContents(String, String)
to replace the content of a workspace file.
path
- the full path of the workspace file to create.localFilePath
- the local file with the contents for the new workspace file.createParentFolders
- flag that indicates that missing parent folders are automatically created.WorkspaceItemNotFoundException
- thrown when createParentFolders
is set to False
and a parent
folder in the specified path does not exist.WorkspaceItemExistsException
- thrown when a folder or file exists at the specified path.IOException
- thrown when there is a problem streaming the file contents from disk.WorkspaceItem rename(String path, String name) throws WorkspaceItemNotFoundException, WorkspaceItemExistsException
path
- the path of the workspace item to rename.name
- the new name.WorkspaceItemNotFoundException
- thrown when the workspace item is not found at the specified location.WorkspaceItemExistsException
- thrown when a workspace item exists in the same folder with the new name.WorkspaceItem move(String sourcePath, String destinationPath) throws WorkspaceItemNotFoundException, WorkspaceItemExistsException, WorkspaceItemMoveException
sourcePath
- the path of the folder or file to move.destinationPath
- the path of the destination in which to move the file or folder. This includes the name of the item.WorkspaceItemNotFoundException
- thrown when the specified source folder or file is not found.WorkspaceItemExistsException
- thrown when a workspace item exists at the destination path.WorkspaceItemMoveException
- thrown when the move request is not possible.WorkspaceItem copy(String sourcePath, String destinationPath) throws WorkspaceItemNotFoundException, WorkspaceItemCopyException, WorkspaceItemExistsException
sourcePath
- the path of the folder or file to copy.destinationPath
- the path of the destination in which to copy the folder or file. This includes the name of the copy.WorkspaceItemNotFoundException
- thrown when the specified source item or destination parent folder is not found.WorkspaceItemCopyException
- thrown when the copy request is not possible. Typically, the destination path is
a child of the source path.WorkspaceItemExistsException
- thrown when a folder or file exists at the destination path.void delete(String path) throws WorkspaceItemNotFoundException, WorkspaceItemDeleteException
path
- the path of the folder or file to delete.WorkspaceItemNotFoundException
- thrown when the folder or file does not exist.WorkspaceItemDeleteException
- thrown when the specified folder or file could not be deleted.void downloadFile(String path, String outputFilePath) throws WorkspaceItemNotFoundException, IOException
path
- the workspace file to download.outputFilePath
- the local file system location in which to store the workspace file.WorkspaceItemNotFoundException
- thrown when the specified file is not found in the workspace.IOException
- thrown when there is a problem streaming the file to disk.boolean exists(String path)
path
- the path of the workspace folder or file.True
, if an item exists at the specified path, False
otherwise.WorkspaceItem getItem(String path) throws WorkspaceItemNotFoundException
path
- the path of the folder or file in the workspace.WorkspaceItemNotFoundException
- thrown when a folder or file is not found at the location.List<WorkspaceItem> getChildren(String path) throws WorkspaceItemNotFoundException
path
- the workspace folder path to retrieve.WorkspaceItemNotFoundException
- thrown when the folder specified is not be found in the workspace.WorkspaceFile updateFileContents(String path, String localFilePath) throws WorkspaceItemNotFoundException, IOException
Use createFile(String, String, boolean)
to put content into a file that does not yet
exist in the workspace.
path
- the full path of the workspace file to update.localFilePath
- the full path of the local file system file with the new content replace the workspace file.WorkspaceItemNotFoundException
- thrown when the workspace file is not found at the specified location.IOException
- thrown when there is a problem streaming the file from disk or to the server.void markForAdd(String path) throws WorkspaceItemNotFoundException, WorkspaceMarkForAddException
path
- the path of file to mark for addition. Only file paths are supported.WorkspaceItemNotFoundException
- thrown when the workspace file is not found at the specified location.WorkspaceMarkForAddException
- Thrown when the specified workspace file could not be marked for addition.SynchronizationInfo.CheckoutStatus getCheckoutStatus(String path) throws WorkspaceItemNotFoundException
checkout
status of the file. If the file exists in the repository, it can be
checked-out or not checked-out. If the file exists in the workspace, it can be marked for addition in the
repository.path
- the path of the workspace file.WorkspaceItemNotFoundException
- thrown when the workspace file is not found at the specified location.Copyright (c) 2020, SAS Institute Inc., Cary, NC, USA