com.xiaomi.infra.galaxy.fds.client.model.FDSUploadPartCopyRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of galaxy-fds-sdk-java Show documentation
Show all versions of galaxy-fds-sdk-java Show documentation
Xiaomi File Storage Service SDK
The newest version!
package com.xiaomi.infra.galaxy.fds.client.model;
import com.xiaomi.infra.galaxy.fds.client.Utils;
public class FDSUploadPartCopyRequest {
private String srcBucketName;
private String srcObjectName;
private String dstBucketName;
private String dstObjectName;
private String uploadId;
private int partNumber;
private long beginRange = -1L;
private long endRange = -1L;
public FDSUploadPartCopyRequest(String srcBucketName, String srcObjectName, String dstBucketName,
String dstObjectName, String uploadId, int partNumber) {
this.srcBucketName = srcBucketName;
this.srcObjectName = srcObjectName;
this.dstBucketName = dstBucketName;
this.dstObjectName = dstObjectName;
this.uploadId = uploadId;
this.partNumber = partNumber;
}
public FDSUploadPartCopyRequest(String srcBucketName, String srcObjectName, String dstBucketName,
String dstObjectName, String uploadId, int partNumber, long beginRange, long endRange) {
this.srcBucketName = srcBucketName;
this.srcObjectName = srcObjectName;
this.dstBucketName = dstBucketName;
this.dstObjectName = dstObjectName;
this.uploadId = uploadId;
this.partNumber = partNumber;
this.beginRange = beginRange;
this.endRange = endRange;
}
public String getSrcBucketName() {
return srcBucketName;
}
public void setSrcBucketName(String srcBucketName) {
this.srcBucketName = srcBucketName;
}
public String getSrcObjectName() {
return srcObjectName;
}
public void setSrcObjectName(String srcObjectName) {
this.srcObjectName = srcObjectName;
}
public String getDstBucketName() {
return dstBucketName;
}
public void setDstBucketName(String dstBucketName) {
this.dstBucketName = dstBucketName;
}
public String getDstObjectName() {
return dstObjectName;
}
public void setDstObjectName(String dstObjectName) {
this.dstObjectName = dstObjectName;
}
public String getUploadId() {
return uploadId;
}
public void setUploadId(String uploadId) {
this.uploadId = uploadId;
}
public int getPartNumber() {
return partNumber;
}
public void setPartNumber(int partNumber) {
this.partNumber = partNumber;
}
public long getBeginRange() {
return beginRange;
}
public void setBeginRange(long beginRange) {
this.beginRange = beginRange;
}
public long getEndRange() {
return endRange;
}
public void setEndRange(long endRange) {
this.endRange = endRange;
}
public String getCopySourceHeader() {
return "/" + this.srcBucketName + "/" + Utils.urlEncode(this.srcObjectName, Utils.UTF8_CHARSET);
}
public String getCopySourceRangeHeader() {
if (beginRange != -1L && endRange != -1L) {
return "bytes=" + beginRange + "-" + endRange;
}
return null;
}
@Override
public String toString() {
return "FDSUploadPartCopyRequest{" +
"srcBucketName='" + srcBucketName + '\'' +
", srcObjectName='" + srcObjectName + '\'' +
", dstBucketName='" + dstBucketName + '\'' +
", dstObjectName='" + dstObjectName + '\'' +
", uploadId='" + uploadId + '\'' +
", partNumber='" + partNumber + '\'' +
", beginRange='" + beginRange + '\'' +
", endRange='" + endRange + '\'' +
'}';
}
}