com.aliyun.oss.model

## 类 DownloadFileRequest

- java.lang.Object
- - com.aliyun.oss.model.WebServiceRequest
  - - com.aliyun.oss.model.GenericRequest
    - - com.aliyun.oss.model.DownloadFileRequest

-     public class DownloadFileRequest
      extends GenericRequest

  The request class that is to download file with multiple parts download.

- - ### 字段概要

    - ### 从类继承的字段 com.aliyun.oss.model.WebServiceRequest

      `NOOP`

  - ### 构造器概要

    构造器
    构造器和说明
    `DownloadFileRequest(String bucketName, String key)`
    `DownloadFileRequest(String bucketName, String key, String downloadFile, long partSize)`
    `DownloadFileRequest(String bucketName, String key, String downloadFile, long partSize, int taskNum, boolean enableCheckpoint)`
    `DownloadFileRequest(String bucketName, String key, String downloadFile, long partSize, int taskNum, boolean enableCheckpoint, String checkpointFile)`

  - ### 方法概要

    方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `clearMatchingETagConstraints()`
    `void` | `clearNonmatchingETagConstraints()`
    `String` | `getCheckpointFile()`
    `String` | `getDownloadFile()`
    `List<String>` | `getMatchingETagConstraints()` Gets the ETag matching constraints.
    `Date` | `getModifiedSinceConstraint()` Gets the modified since constraint.
    `List<String>` | `getNonmatchingETagConstraints()` Gets the ETag non-matching constraints.
    `long` | `getPartSize()`
    `long[]` | `getRange()` Gets the range of the object to download.
    `ResponseHeaderOverrides` | `getResponseHeaders()` Gets response headers to override.
    `int` | `getTaskNum()`
    `String` | `getTempDownloadFile()`
    `int` | `getTrafficLimit()` Gets traffic limit speed, its unit is bit/s
    `Date` | `getUnmodifiedSinceConstraint()` Gets the unmodified since constraint.
    `boolean` | `isEnableCheckpoint()`
    `void` | `setCheckpointFile(String checkpointFile)`
    `void` | `setDownloadFile(String downloadFile)`
    `void` | `setEnableCheckpoint(boolean enableCheckpoint)`
    `void` | `setMatchingETagConstraints(List<String> eTagList)` Sets the ETag matching constraints (optional).
    `void` | `setModifiedSinceConstraint(Date date)` Sets the modified since constraint.
    `void` | `setNonmatchingETagConstraints(List<String> eTagList)` Sets the ETag non-matching constraints.
    `void` | `setPartSize(long partSize)`
    `void` | `setRange(long start, long end)` Sets the range of the object to download (optional).
    `void` | `setResponseHeaders(ResponseHeaderOverrides responseHeaders)` Sets response headers to override.
    `void` | `setTaskNum(int taskNum)`
    `void` | `setTrafficLimit(int trafficLimit)` Sets traffic limit speed, its unit is bit/s
    `void` | `setUnmodifiedSinceConstraint(Date date)` Sets the unmodified since constraint.

    - ### 从类继承的方法 com.aliyun.oss.model.GenericRequest

      `getBucketName, getKey, getRequestPayer, getVersionId, setBucketName, setKey, setRequestPayer, setVersionId, withBucketName, withKey, withRequestPayer, withVersionId`

    - ### 从类继承的方法 com.aliyun.oss.model.WebServiceRequest

      `addAdditionalHeaderName, addHeader, addParameter, getAdditionalHeaderNames, getHeaders, getParameters, getProgressListener, isLogEnabled, setAdditionalHeaderNames, setHeaders, setLogEnabled, setParameters, setProgressListener, withProgressListener`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### DownloadFileRequest

          public DownloadFileRequest(String bucketName,
                             String key)

    - #### DownloadFileRequest

          public DownloadFileRequest(String bucketName,
                             String key,
                             String downloadFile,
                             long partSize)

    - #### DownloadFileRequest

          public DownloadFileRequest(String bucketName,
                             String key,
                             String downloadFile,
                             long partSize,
                             int taskNum,
                             boolean enableCheckpoint)

    - #### DownloadFileRequest

          public DownloadFileRequest(String bucketName,
                             String key,
                             String downloadFile,
                             long partSize,
                             int taskNum,
                             boolean enableCheckpoint,
                             String checkpointFile)

  - ### 方法详细资料

    - #### getPartSize

          public long getPartSize()

    - #### setPartSize

          public void setPartSize(long partSize)

    - #### getTaskNum

          public int getTaskNum()

    - #### setTaskNum

          public void setTaskNum(int taskNum)

    - #### getDownloadFile

          public String getDownloadFile()

    - #### getTempDownloadFile

          public String getTempDownloadFile()

    - #### setDownloadFile

          public void setDownloadFile(String downloadFile)

    - #### isEnableCheckpoint

          public boolean isEnableCheckpoint()

    - #### setEnableCheckpoint

          public void setEnableCheckpoint(boolean enableCheckpoint)

    - #### getCheckpointFile

          public String getCheckpointFile()

    - #### setCheckpointFile

          public void setCheckpointFile(String checkpointFile)

    - #### getMatchingETagConstraints

          public List<String> getMatchingETagConstraints()

      Gets the ETag matching constraints. The download only happens if the specified ETag matches the source file's ETag. If ETag does not match, returns the precondition failure (412)
      返回:
        The expected ETag list.

    - #### setMatchingETagConstraints

          public void setMatchingETagConstraints(List<String> eTagList)

      Sets the ETag matching constraints (optional). The download only happens if the specified ETag matches the source file's ETag. If ETag does not match, returns the precondition failure (412)
      参数:
        `eTagList` - The expected ETag list.

    - #### clearMatchingETagConstraints

          public void clearMatchingETagConstraints()

    - #### getNonmatchingETagConstraints

          public List<String> getNonmatchingETagConstraints()

      Gets the ETag non-matching constraints. The download only happens if the specified ETag does not match the source file's ETag. If ETag matches, returns the precondition failure (412)
      返回:
        The expected ETag list.

    - #### setNonmatchingETagConstraints

          public void setNonmatchingETagConstraints(List<String> eTagList)

      Sets the ETag non-matching constraints. The download only happens if the specified ETag does not match the source file's ETag. If ETag matches, returns the precondition failure (412)
      参数:
        `eTagList` - The expected ETag list. For now only the first ETag is used, though the parameter is the list.

    - #### clearNonmatchingETagConstraints

          public void clearNonmatchingETagConstraints()

    - #### getUnmodifiedSinceConstraint

          public Date getUnmodifiedSinceConstraint()

      Gets the unmodified since constraint.
      返回:
        The time threshold. If it's same or later than the actual modified time, download the file.

    - #### setUnmodifiedSinceConstraint

          public void setUnmodifiedSinceConstraint(Date date)

      Sets the unmodified since constraint.
      参数:
        `date` - The time threshold. If it's same or later than the actual modified time, download the file.

    - #### getModifiedSinceConstraint

          public Date getModifiedSinceConstraint()

      Gets the modified since constraint.
      返回:
        The time threshold. If it's earlier than the actual modified time, download the file.

    - #### setModifiedSinceConstraint

          public void setModifiedSinceConstraint(Date date)

      Sets the modified since constraint.
      参数:
        `date` - The time threshold. If it's earlier than the actual modified time, download the file.

    - #### getResponseHeaders

          public ResponseHeaderOverrides getResponseHeaders()

      Gets response headers to override.
      返回:
        The headers to override with.

    - #### setResponseHeaders

          public void setResponseHeaders(ResponseHeaderOverrides responseHeaders)

      Sets response headers to override.
      参数:
        `responseHeaders` - The headers to override with.

    - #### setTrafficLimit

          public void setTrafficLimit(int trafficLimit)

      Sets traffic limit speed, its unit is bit/s

    - #### getTrafficLimit

          public int getTrafficLimit()

      Gets traffic limit speed, its unit is bit/s
      返回:
        traffic limit speed

    - #### getRange

          public long[] getRange()

      Gets the range of the object to download. The range is in the form of {start, end}---start and end is position of the object's content.
      返回:
        The range of the object to download.

    - #### setRange

          public void setRange(long start,
                      long end)

      Sets the range of the object to download (optional).
      参数:
        `start` -

        Start position

        When the start is non-negative, it means the starting position to download. When the start is -1, it means the range is determined by the end only and the end could not be -1. For example, when start is -1 and end is 100. It means the download range will be the last 100 bytes.

        `end` -

        End position

        When the end is non-negative, it means the ending position to download. When the end is -1, it means the range is determined by the start only and the start could not be -1. For example, when end is -1 and start is 100. It means the download range will be all exception first 100 bytes.

Copyright © 2020. All Rights Reserved.