|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WorkspaceResourceService
Service for manipulating files and folders in a user's workspace.
Method Summary | |
---|---|
WorkspaceResource |
copy(String sourcePath,
String targetPath)
Copy the file or folder from sourcePath into targetFolder and give the new copy the name newName. |
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. |
WorkspaceFile |
updateFileContents(String path,
String localFilePath)
Replace the current content of the workspace file with the content of the specified local file. |
Method Detail |
---|
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
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 targetPath) throws WorkspaceResourceNotFoundException, WorkspaceResourceCopyException, WorkspaceResourceExistsException
sourcePath
- The path of the file or folder to copy.targetPath
- The path of the target file or folder to create.
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 in the targetFolder with the name newName.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
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |