From d469c56448bf3c3a20e88593b3205d989391c1e8 Mon Sep 17 00:00:00 2001 From: simon-liubin Date: Mon, 21 Apr 2014 15:45:34 +0800 Subject: [PATCH] add mimetype limit --- src/main/java/com/qiniu/api/rs/PutPolicy.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/qiniu/api/rs/PutPolicy.java b/src/main/java/com/qiniu/api/rs/PutPolicy.java index 73f55555d..7c54cc02a 100644 --- a/src/main/java/com/qiniu/api/rs/PutPolicy.java +++ b/src/main/java/com/qiniu/api/rs/PutPolicy.java @@ -40,6 +40,10 @@ public class PutPolicy { public int detectMime; /** 可选 */ public long fsizeLimit; + /**限定用户上传的文件类型 + * 可选 + * */ + public String mimeLimit; /** 可选 */ public String persistentNotifyUrl; /** 可选 */ @@ -104,6 +108,9 @@ public String marshal() throws JSONException { if(this.fsizeLimit>0){ stringer.key("fsizeLimit").value(this.fsizeLimit); } + if(this.mimeLimit != null && this.mimeLimit.length() > 0){ + stringer.key("mimeLimit").value(this.mimeLimit); + } if (this.endUser != null && this.endUser.length() > 0) { stringer.key("endUser").value(this.endUser); }