Package com.sas.lsaf.content.workspace
Interface BatchWorkspaceService
public interface BatchWorkspaceService
A service to perform batch operations in the current user's workspace.
The methods in this service are a best effort that means when an error occurs with one resource, the method continues to the next resource.
Each method returns an ActionStatus with a
ActionStatus.CompletionStatus and message that indicates the overall status. The ActionStatus
also contains a list of ActionStatusDetails, which provides the status of each file.
- Since:
- 1.5
-
Method Summary
Modifier and TypeMethodDescriptionvoiddownloadAsZip(Set<String> paths, String localFilePath, boolean overwrite) Takes the workspace paths in the selected set and downloads them to the specified zip file .uploadAndExpand(String parentPath, String localFilePath, boolean createParentFolders) Unzips the specified zip file and saves the contents to the specified workspace location.
-
Method Details
-
uploadAndExpand
Unzips the specified zip file and saves the contents to the specified workspace location.- Parameters:
parentPath- The parent path of the container in which to create and expand the contents of the specified zip.localFilePath- The local file path of the zip file in which to upload and expand.createParentFolders- whether to create parent containers, if they do not exist.- Returns:
- The summary status of the batch upload operation.
-
downloadAsZip
void downloadAsZip(Set<String> paths, String localFilePath, boolean overwrite) throws WorkspaceItemNotFoundException, IOException Takes the workspace paths in the selected set and downloads them to the specified zip file . The paths can be file path or container paths. If a container path is specified, all of that container's contents included in the zip file.- Parameters:
paths- the list of paths to download to the zip file.localFilePath- the local file path in which to save the zip file.overwrite- indicates whether to overwrite the local zip file, if it exists.- Throws:
WorkspaceItemNotFoundException- thrown when one of the paths for download is not found.IOException- thrown if there is a problem streaming the file contents.
-