Skip to content

Commit b1bd8da

Browse files
authored
Add long type content-length range condition in PostPolicy. (#1270)
Signed-off-by: Bala.FA <[email protected]>
1 parent aaf6b4c commit b1bd8da

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

api/src/main/java/io/minio/PostPolicy.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public class PostPolicy {
5656
private String bucketName;
5757
private ZonedDateTime expiration;
5858
private Map<String, Map<String, String>> conditions;
59-
private Integer lowerLimit = null;
60-
private Integer upperLimit = null;
59+
private Long lowerLimit = null;
60+
private Long upperLimit = null;
6161

6262
public PostPolicy(@Nonnull String bucketName, @Nonnull ZonedDateTime expiration) {
6363
if (bucketName.isEmpty()) {
@@ -140,7 +140,7 @@ public void removeStartsWithCondition(String element) {
140140
}
141141

142142
/** Add content-length-range condition with lower and upper limits. */
143-
public void addContentLengthRangeCondition(int lowerLimit, int upperLimit) {
143+
public void addContentLengthRangeCondition(long lowerLimit, long upperLimit) {
144144
if (lowerLimit < 0) {
145145
throw new IllegalArgumentException("lower limit cannot be negative number");
146146
}
@@ -157,6 +157,11 @@ public void addContentLengthRangeCondition(int lowerLimit, int upperLimit) {
157157
this.upperLimit = upperLimit;
158158
}
159159

160+
/** Add content-length-range condition with lower and upper limits. */
161+
public void addContentLengthRangeCondition(int lowerLimit, int upperLimit) {
162+
this.addContentLengthRangeCondition((long) lowerLimit, (long) upperLimit);
163+
}
164+
160165
/** Remove previously set content-length-range condition. */
161166
public void removeContentLengthRangeCondition() {
162167
this.lowerLimit = null;

0 commit comments

Comments
 (0)