public interface WorkspaceResourceService
Modifier and Type | Method and Description |
---|---|
WorkspaceResource |
copy(String sourcePath,
String destinationPath)
Copy the file or folder from the source path to the destination path.
|
WorkspaceFile |
createFile(String path,
String localFilePath,
boolean createParentFolders)
Create a new file in the workspace.
|
WorkspaceFolder |
createFolder(String path,
boolean createParentFolders)
Create a folder at the given location.
|
void |
delete(String path)
Delete the specified resource in the workspace.
|
void |
downloadFile(String path,
String outputFilePath)
Download the contents of a specified workspace file to the specified local file.
|
boolean |
exists(String path)
Indicates if the specified resource exists in the workspace.
|
List<WorkspaceResource> |
getChildren(String path)
Return the children of the specified workspace folder.
|
WorkspaceResource |
getResource(String path)
Get a client representation of the specified resource in the workspace.
|
WorkspaceResource |
move(String sourcePath,
String destinationFolderPath)
Move the file or folder from one location to another.
|
WorkspaceResource |
rename(String path,
String name)
Rename the workspace resource.
|
WorkspaceFile |
updateFileContents(String path,
String localFilePath)
Replace the current content of the workspace file with the content of the specified local file.
|
WorkspaceFolder createFolder(String path, boolean createParentFolders) throws WorkspaceResourceNotFoundException, WorkspaceResourceExistsException
path
- The folder to create.createParentFolders
- Flag indicating if missing parent containers should be automatically created during
this operation.WorkspaceResourceNotFoundException
- Thrown if createParentFolders is set to false and an expected folder
container does NOT exist.WorkspaceResourceExistsException
- Thrown when the requested folder already exists.WorkspaceFile createFile(String path, String localFilePath, boolean createParentFolders) throws WorkspaceResourceNotFoundException, WorkspaceResourceExistsException, IOException
updateFileContents(String, String)
if you wish to replace the content of an existing workspace file.path
- The full path of the workspace file to be created.localFilePath
- The local file with the contents for the new WorkspaceFile.createParentFolders
- Flag indicating if missing parent containers should be automatically created during
this operation.WorkspaceResourceNotFoundException
- Thrown if you did not specify createParentFolders=true, and one of the
parent containers specified for this new resource does not already exist.WorkspaceResourceExistsException
- Throw if a file already exists at the specified path.IOException
- see the exception text for more details.WorkspaceResource copy(String sourcePath, String destinationPath) throws WorkspaceResourceNotFoundException, WorkspaceResourceCopyException, WorkspaceResourceExistsException
sourcePath
- The path of the file or folder to copy.destinationPath
- The path of the destination file or folder to create, this includes the name of the newly
created copy.WorkspaceResourceNotFoundException
- The specified source resource was not found.WorkspaceResourceCopyException
- The copy request is not possible; typically the destination path was a
child of the source path.WorkspaceResourceExistsException
- A resource already exists at the destination path.void delete(String path) throws WorkspaceResourceNotFoundException, WorkspaceResourceDeleteException
path
- The full path of the resource to be deleted.WorkspaceResourceNotFoundException
- The specified resource was not found in your workspace.WorkspaceResourceDeleteException
- The specified resource could not be deleted.void downloadFile(String path, String outputFilePath) throws WorkspaceResourceNotFoundException, IOException
path
- The workspace file you wish to download.outputFilePath
- The file location you would like the workspaceFile contents to be placed.WorkspaceResourceNotFoundException
- The specified resource was not found in your workspace.IOException
- see the exception text for more details.boolean exists(String path)
path
- The path of the workspace resource.List<WorkspaceResource> getChildren(String path) throws WorkspaceResourceNotFoundException
path
- The parent folder.WorkspaceResourceNotFoundException
- The parent folder specified can not be found in the workspace.WorkspaceResource getResource(String path) throws WorkspaceResourceNotFoundException
path
- The path of the resource.WorkspaceResourceNotFoundException
- Thrown if a resource is not found at that location.WorkspaceFile updateFileContents(String path, String localFilePath) throws WorkspaceResourceNotFoundException, IOException
createFile(String, String, boolean)
if you wish to put content into a file that doesn't already
exist in your workspace.path
- The full path of the existing workspace file to be updatedlocalFilePath
- The name of the local file with the new contents to be put in the workspace file.WorkspaceResourceNotFoundException
- A resource was not found at the specified location.IOException
- see the exception text for more details.WorkspaceResource rename(String path, String name) throws WorkspaceResourceNotFoundException, WorkspaceResourceExistsException
path
- The path of the workspace resource to rename.name
- The new nameWorkspaceResourceNotFoundException
- A resource was not found at the specified location.WorkspaceResourceExistsException
- A resource already exists in the targetFolder with the name newName.WorkspaceResource move(String sourcePath, String destinationFolderPath) throws WorkspaceResourceNotFoundException, WorkspaceResourceExistsException, WorkspaceResourceMoveException
sourcePath
- The path of the file or folder to move.destinationFolderPath
- The folder to move the resource to.WorkspaceResourceNotFoundException
- The specified source resource was not found.WorkspaceResourceExistsException
- A resource already exists at the destination path.WorkspaceResourceMoveException
- The move request was not possible.Copyright (c) 2017, SAS Institute Inc., Cary, NC, USA