Skip to content

Commit 310147b

Browse files
committed
3.20.3 en
1 parent 131077f commit 310147b

26 files changed

+1650
-1
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/**
2+
* Copyright 2019 Huawei Technologies Co.,Ltd.
3+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4+
* this file except in compliance with the License. You may obtain a copy of the
5+
* License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed
10+
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
12+
* specific language governing permissions and limitations under the License.
13+
*/
14+
15+
package com.obs.services.model;
16+
17+
/**
18+
* Basic class of bucket requests
19+
*
20+
* @since 3.20.3
21+
*
22+
*/
23+
public class BaseBucketRequest extends GenericRequest {
24+
private String bucketName;
25+
26+
public BaseBucketRequest() {
27+
28+
}
29+
30+
public BaseBucketRequest(String bucketName) {
31+
this.bucketName = bucketName;
32+
}
33+
34+
/**
35+
* Obtain the bucket name.
36+
*
37+
* @return Bucket name
38+
*/
39+
public String getBucketName() {
40+
return bucketName;
41+
}
42+
43+
/**
44+
* Set the bucket name.
45+
*
46+
* @param bucketName
47+
* Bucket name
48+
*/
49+
public void setBucketName(String bucketName) {
50+
this.bucketName = bucketName;
51+
}
52+
53+
@Override
54+
public String toString() {
55+
return "BaseBucketRequest [bucketName=" + bucketName + ", isRequesterPays()=" + isRequesterPays() + "]";
56+
}
57+
}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
/**
2+
* Copyright 2019 Huawei Technologies Co.,Ltd.
3+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4+
* this file except in compliance with the License. You may obtain a copy of the
5+
* License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed
10+
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
12+
* specific language governing permissions and limitations under the License.
13+
*/
14+
15+
package com.obs.services.model;
16+
17+
/**
18+
* Basic class of object requests
19+
*
20+
* @since 3.20.3
21+
*/
22+
public class BaseObjectRequest extends GenericRequest {
23+
private String bucketName;
24+
private String objectKey;
25+
private String versionId;
26+
27+
public BaseObjectRequest() {
28+
}
29+
30+
public BaseObjectRequest(String bucketName, String objectKey) {
31+
this.bucketName = bucketName;
32+
this.objectKey = objectKey;
33+
}
34+
35+
public BaseObjectRequest(String bucketName, String objectKey, String versionId) {
36+
this(bucketName, objectKey);
37+
this.versionId = versionId;
38+
}
39+
40+
/**
41+
* Obtain the bucket name.
42+
*
43+
* @return Bucket name
44+
*/
45+
public String getBucketName() {
46+
return bucketName;
47+
}
48+
49+
/**
50+
* Set the bucket name.
51+
*
52+
* @param bucketName
53+
* Bucket name
54+
*/
55+
public void setBucketName(String bucketName) {
56+
this.bucketName = bucketName;
57+
}
58+
59+
/**
60+
* Obtain the object name.
61+
*
62+
* @return Object name
63+
*/
64+
public String getObjectKey() {
65+
return objectKey;
66+
}
67+
68+
/**
69+
* Set the object name.
70+
*
71+
* @param objectKey
72+
* Object name
73+
*/
74+
public void setObjectKey(String objectKey) {
75+
this.objectKey = objectKey;
76+
}
77+
78+
/**
79+
* Obtain the object version ID.
80+
*
81+
* @return Version ID of the object
82+
*/
83+
public String getVersionId() {
84+
return versionId;
85+
}
86+
87+
/**
88+
* Set the version ID of the object.
89+
*
90+
* @param versionId
91+
* Version ID of the object
92+
*/
93+
public void setVersionId(String versionId) {
94+
this.versionId = versionId;
95+
}
96+
97+
@Override
98+
public String toString() {
99+
return "BaseObjectRequest [bucketName=" + bucketName + ", objectKey=" + objectKey + ", versionId=" + versionId
100+
+ ", isRequesterPays()=" + isRequesterPays() + "]";
101+
}
102+
}
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
/**
2+
* Copyright 2019 Huawei Technologies Co.,Ltd.
3+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4+
* this file except in compliance with the License. You may obtain a copy of the
5+
* License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed
10+
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
12+
* specific language governing permissions and limitations under the License.
13+
*/
14+
15+
package com.obs.services.model;
16+
17+
/**
18+
* Request parameters for deleting an object.
19+
*
20+
* @since 3.20.3
21+
*/
22+
public class DeleteObjectRequest extends GenericRequest {
23+
private String bucketName;
24+
25+
private String objectKey;
26+
27+
private String versionId;
28+
29+
public DeleteObjectRequest() {
30+
31+
}
32+
33+
/**
34+
* Constructor
35+
*
36+
* @param bucketName
37+
* Bucket name
38+
* @param objectKey
39+
* Object name
40+
*/
41+
public DeleteObjectRequest(String bucketName, String objectKey) {
42+
this.bucketName = bucketName;
43+
this.objectKey = objectKey;
44+
}
45+
46+
/**
47+
* Constructor
48+
*
49+
* @param bucketName
50+
* Bucket name
51+
* @param objectKey
52+
* Object name
53+
* @param versionId
54+
* Object version ID
55+
*/
56+
public DeleteObjectRequest(String bucketName, String objectKey, String versionId) {
57+
this(bucketName, objectKey);
58+
this.versionId = versionId;
59+
}
60+
61+
/**
62+
* Obtain the version ID of the object to be deleted.
63+
*
64+
* @return Version ID of the object to be deleted
65+
*/
66+
public String getVersionId() {
67+
return versionId;
68+
}
69+
70+
/**
71+
* Set the version ID of the object to be deleted.
72+
73+
* @param versionId
74+
* Version ID of the object to be deleted
75+
*/
76+
public void setVersionId(String versionId) {
77+
this.versionId = versionId;
78+
}
79+
80+
/**
81+
* Obtain the name of the bucket to which the to-be-deleted object belongs.
82+
*
83+
* @return Name of the bucket to which the to-be-deleted object belongs
84+
*/
85+
public String getBucketName() {
86+
return bucketName;
87+
}
88+
89+
/**
90+
* Set the name of the bucket to which the to-be-deleted object belongs.
91+
*
92+
* @param bucketName
93+
* Name of the bucket to which the to-be-deleted object belongs
94+
*/
95+
public void setBucketName(String bucketName) {
96+
this.bucketName = bucketName;
97+
}
98+
99+
/**
100+
* Obtain the name of the object to be deleted.
101+
*
102+
* @return Name of the object to be deleted
103+
*/
104+
public String getObjectKey() {
105+
return objectKey;
106+
}
107+
108+
/**
109+
* Set the name of the object to be deleted.
110+
*
111+
* @param objectKey
112+
* Name of the object to be deleted
113+
*/
114+
public void setObjectKey(String objectKey) {
115+
this.objectKey = objectKey;
116+
}
117+
118+
@Override
119+
public String toString() {
120+
return "AbortMultipartUploadRequest [bucketName=" + bucketName + ", objectKey="
121+
+ objectKey + ", versionId=" + versionId + "]";
122+
}
123+
124+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/**
2+
* Copyright 2019 Huawei Technologies Co.,Ltd.
3+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4+
* this file except in compliance with the License. You may obtain a copy of the
5+
* License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed
10+
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
12+
* specific language governing permissions and limitations under the License.
13+
*/
14+
15+
package com.obs.services.model;
16+
17+
/**
18+
* Basic class of all requests, which encapsulates common parameters used by all requests.
19+
*
20+
* @since 3.20.3
21+
*/
22+
public class GenericRequest {
23+
/**
24+
* If the requester-pays function is enabled, the requester pays for his/her operations on the bucket.
25+
*/
26+
private boolean isRequesterPays;
27+
28+
/**
29+
* If the requester is allowed to pay, true is returned. Otherwise, false is returned.
30+
*
31+
* <p>
32+
* If the requester-pays function is enabled for a bucket, this attribute must be set to true when the bucket is requested by a requester other than the bucket owner. Otherwise, status code 403 is returned.
33+
*
34+
* <p>
35+
* After the requester-pays function is enabled, anonymous access to the bucket is not allowed.
36+
*
37+
* @return If the requester is allowed to pay, true is returned. Otherwise, false is returned.
38+
*/
39+
public boolean isRequesterPays() {
40+
return isRequesterPays;
41+
}
42+
43+
/**
44+
* Used to configure whether to enable the requester-pays function.
45+
*
46+
* <p>
47+
* If the requester-pays function is enabled for a bucket, this attribute must be set to true when the bucket is requested by a requester other than the bucket owner. Otherwise, status code 403 is returned.
48+
*
49+
* <p>
50+
* After the requester-pays function is enabled, anonymous access to the bucket is not allowed.
51+
*
52+
* @param isRequesterPays True indicates to enable the requester-pays function. False indicates to disable the requester-pays function.
53+
*/
54+
public void setRequesterPays(boolean isRequesterPays) {
55+
this.isRequesterPays = isRequesterPays;
56+
}
57+
58+
@Override
59+
public String toString() {
60+
return "GenericRequest [isRequesterPays=" + isRequesterPays + "]";
61+
}
62+
}

0 commit comments

Comments
 (0)