Package com.sas.lsaf.content.repository

## Interface BatchRepositoryService

-     public interface BatchRepositoryService

  The service to perform batch operations in the repository.

  The methods in this service are a best effort, which means that if an error occurs with one resource, the error continues on to the next resource.

  Each method returns an `ActionStatus` with a `ActionStatus.CompletionStatus` and message that indicates the overall completion status. The ActionStatus also contains a list of `ActionStatusDetail`s, which indicates the status of each file.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ActionStatus` | `checkin​(java.util.List<java.lang.String> paths, RepositoryCheckinSpecification checkinSpecification)` | Checks in all of the files that are specified in the list of paths (which can contain container paths and file paths) that are ready for check in.
    `ActionStatus` | `checkout​(java.util.List<java.lang.String> paths)` | Checks out all of the files that are specified in the list of paths (which can contain container paths and file paths).
    `void` | `downloadAsZip​(java.util.Set<java.lang.String> paths, java.lang.String localFilePath, boolean overwrite)` | Downloads the files from a specified set of paths to a the zip file.
    `ActionStatus` | `uploadAndExpand​(java.lang.String parentPath, java.lang.String localZipFilePath, boolean enableVersioningOnAllNewFiles, RepositoryCheckinSpecification checkinSpecification, boolean createParentFolders)` | Unzips the zip file that is specified in localZipFilePath and saves the contents to the repository location that is specified in parentPath.

- - ### Method Detail

    - #### checkout

          ActionStatus checkout​(java.util.List<java.lang.String> paths)

      Checks out all of the files that are specified in the list of paths (which can contain container paths and file paths). If container paths are specified, the method recursively checks out all of the files that are below the specified location.
      Parameters:
        `paths` - The list of paths.
      Returns:
        The status of the batch checkout operation, which includes the status of each file that was acted upon.

    - #### checkin

          ActionStatus checkin​(java.util.List<java.lang.String> paths,
                               RepositoryCheckinSpecification checkinSpecification)

      Checks in all of the files that are specified in the list of paths (which can contain container paths and file paths) that are ready for check in. If container paths are specified, the method recursively checks out all of the files below the listed paths. If a file is marked for addition in the current user's workspace, it is checked in.

      If `null` is specified for checkin, it is interpreted as a blank comment and the `MINOR` version update value, if the file is versioned.

      Parameters:
        `paths` - The list of paths.
        `checkinSpecification` - The method to check in files. If null is specified and the files are versioned, the version defaults to a MAJOR version.
      Returns:
        The status of the batch checkin operation, which includes the status of each file that was acted upon.

    - #### uploadAndExpand

          ActionStatus uploadAndExpand​(java.lang.String parentPath,
                                       java.lang.String localZipFilePath,
                                       boolean enableVersioningOnAllNewFiles,
                                       RepositoryCheckinSpecification checkinSpecification,
                                       boolean createParentFolders)
                                throws java.io.IOException

      Unzips the zip file that is specified in localZipFilePath and saves the contents to the repository location that is specified in parentPath. If files with the same name exist in the repository, and they are versioned, a new version is created. If a file exists, but is not versioned, it is overwritten.

      If `null` is specified for checkin, it is interpreted as a blank comment and the `MAJOR` version update value, if the file is versioned.

      Parameters:
        `parentPath` - The parent path to the container in which to create and expand the contents of the specified zip file.
        `localZipFilePath` - The local file path to the zip file to upload and expand.
        `enableVersioningOnAllNewFiles` - Indicates whether to enable versioning for new files.
        `checkinSpecification` - The method to check in files. Applies to existing versioned files and new files, if enableVersioningOnAllNewFiles is true.
        `createParentFolders` - Indicates whether to create parent containers, if they do not exist.
      Returns:
        The summary status of the batch upload operation.
      Throws:
        `java.io.IOException`

    - #### downloadAsZip

          void downloadAsZip​(java.util.Set<java.lang.String> paths,
                             java.lang.String localFilePath,
                             boolean overwrite)
                      throws RepositoryItemNotFoundException,
                             java.io.IOException

      Downloads the files from a specified set of paths to a the zip file. The paths can be file paths or container paths. If a container path is specified, all of the container's contents are downloaded to the zip file.
      Parameters:
        `paths` - The list of paths to download.
        `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:
        `RepositoryItemNotFoundException`
        `java.io.IOException`