com.sas.hls.resource.repository
Interface BatchRepositoryResourceService


public interface BatchRepositoryResourceService

A service for performing batch operations in the repository. The methods on this service are a best effort which means if an error occurs with one resource, it will continue on to the next.

Each method returns an ActionStatus with a ActionStatus.SummaryStatusCode and message indicating the overall status. The ActionStatus also contains a list of ActionStatusEntrys which provides the status of each file.


Method Summary
 ActionStatus checkin(List<String> paths, ResourceCheckinSpecification checkinSpec)
          Checks in all files specified in the list of paths (can contain container and file paths) that are ready for checkin.
 ActionStatus checkout(List<String> paths)
          Checks out all files specified in the list of paths (can contain container and file paths).
 ActionStatus downloadAsZip(Set<String> paths, String localFilePath, boolean overwrite)
          Takes the repository paths in the selected set and downloads them to the zip file specified in local path.
 ActionStatus uploadAndExpand(String parentPath, String localZipFilePath, boolean enableVersioningOnAllNewFiles, ResourceCheckinSpecification checkinSpec, boolean createParentFolders)
          Unzips the zip file specified in localZipFilePath and saves the contents to the repository location specified in parentPath.
 

Method Detail

checkout

ActionStatus checkout(List<String> paths)
Checks out all files specified in the list of paths (can contain container and file paths). If container paths are provided, it will recursively check out all files below it.

Parameters:
paths - List of paths to be checked out
Returns:
ActionStatus Summary status of the batch checkout operation including a status for each file acted upon.

checkin

ActionStatus checkin(List<String> paths,
                     ResourceCheckinSpecification checkinSpec)
Checks in all files specified in the list of paths (can contain container and file paths) that are ready for checkin. If container paths are provided, it will recursively check out all files below it. If a file is marked for add in the current user's workspace, it will be checked in.

Parameters:
paths - List of paths to be checked in
checkinSpec - The specification of how the files should be checked in. If null is provided and the file is versioned, it will default to a MINOR version.
Returns:
Summary status of the batch checkin operation including a status for each file acted upon.

uploadAndExpand

ActionStatus uploadAndExpand(String parentPath,
                             String localZipFilePath,
                             boolean enableVersioningOnAllNewFiles,
                             ResourceCheckinSpecification checkinSpec,
                             boolean createParentFolders)
Unzips the zip file specified in localZipFilePath and saves the contents to the repository location specified in parentPath. If files with the same name already exist, and they are versioned, a new version will be created. If a file exists, but is not versioned, it will be overwritten.

Parameters:
parentPath - The parent path of the container in which to create the expand the contents of the specified zip.
localZipFilePath - The local file path of the zip in which to upload and expand.
enableVersioningOnAllNewFiles - Whether to enable versioning on new files
checkinSpec - The specification of how the files should be checked in. Applies to existing versioned files, as well as new files if enableVersioningOnAllNewFiles is true.
createParentFolders - Whether to create parent containers if they do not exist.
Returns:
Summary status of the batch upload operation.

downloadAsZip

ActionStatus downloadAsZip(Set<String> paths,
                           String localFilePath,
                           boolean overwrite)
Takes the repository paths in the selected set and downloads them to the zip file specified in local path. Paths can file or container paths. If a container path is specified, all of that container's contents will be downloaded to the zip.

Parameters:
paths - List of paths to be downloaded to a zip
localFilePath - The local file path in which to save the zip.
overwrite - Whether to overwrite the local zip file if it exists.
Returns:
Summary status of the batch download operation.


Copyright (c) 2016, SAS Institute Inc., Cary, NC, USA