Skip to content

Commit

Permalink
Add long type content-length range condition in PostPolicy. (minio#1270)
Browse files Browse the repository at this point in the history
Signed-off-by: Bala.FA <[email protected]>
  • Loading branch information
balamurugana authored Nov 29, 2021
1 parent aaf6b4c commit b1bd8da
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions api/src/main/java/io/minio/PostPolicy.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public class PostPolicy {
private String bucketName;
private ZonedDateTime expiration;
private Map<String, Map<String, String>> conditions;
private Integer lowerLimit = null;
private Integer upperLimit = null;
private Long lowerLimit = null;
private Long upperLimit = null;

public PostPolicy(@Nonnull String bucketName, @Nonnull ZonedDateTime expiration) {
if (bucketName.isEmpty()) {
Expand Down Expand Up @@ -140,7 +140,7 @@ public void removeStartsWithCondition(String element) {
}

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

/** Add content-length-range condition with lower and upper limits. */
public void addContentLengthRangeCondition(int lowerLimit, int upperLimit) {
this.addContentLengthRangeCondition((long) lowerLimit, (long) upperLimit);
}

/** Remove previously set content-length-range condition. */
public void removeContentLengthRangeCondition() {
this.lowerLimit = null;
Expand Down

0 comments on commit b1bd8da

Please sign in to comment.