@@ -41,38 +41,17 @@ public class PutPolicy {
4141 public int detectMime ;
4242 /** 可选 */
4343 public long fsizeLimit ;
44- /**限定用户上传的文件类型
44+ /**限定用户上传的文件类型
4545 * 可选
4646 * */
4747 public String mimeLimit ;
4848 /** 可选 */
4949 public String persistentNotifyUrl ;
5050 /** 可选 */
5151 public String persistentOps ;
52-
53- private long deadline ;
5452
55- /**
56- *
57- * 对文件先进行一次变换操作(比如将音频统一转为某种码率的mp3)再进行存储。
58- * transform的值就是一个fop指令,比如 "avthumb/mp3"。其含义是对上传的文件
59- * 执行这个 fop 指令,然后把结果保存到七牛。最后保存的是经过处理过的文件,
60- * 而不是用户上传的原始文件。
61- *
62- **/
63- public String transform ;
53+ private long deadline ;
6454
65- /**
66- *
67- * 单位: 秒
68- * 文件变换操作执行的超时时间(单位:秒),上传和转码操作是同步进行的,
69- * 先上传后转码,这个时间只是转码所需时间,不包括上传文件所需时间。
70- * 这个值太小可能会导致误判(最终存储成功了但客户端得到超时的错误),
71- * 但太大可能会导致服务端将其判断为低优先级任务。建议取一个相对准确的
72- * 时间估计值*N(N不要超过5)。
73- *
74- **/
75- public long fopTimeout ;
7655
7756 public PutPolicy (String scope ) {
7857 this .scope = scope ;
@@ -121,27 +100,21 @@ public String marshal() throws JSONException {
121100 if (this .persistentOps != null && this .persistentOps .length () > 0 ) {
122101 stringer .key ("persistentOps" ).value (this .persistentOps );
123102 }
124- if (this .transform != null && this .transform .length () > 0 ) {
125- stringer .key ("transform" ).value (this .transform );
126- }
127- if (this .fopTimeout > 0 ) {
128- stringer .key ("fopTimeout" ).value (this .fopTimeout );
129- }
130103 stringer .key ("deadline" ).value (this .deadline );
131104 stringer .endObject ();
132105
133106 return stringer .toString ();
134107 }
135108
136-
109+
137110 /**
138111 * makes an upload token.
139112 * @param mac
140113 * @return
141114 * @throws AuthException
142115 * @throws JSONException
143116 */
144-
117+
145118 public String token (Mac mac ) throws AuthException , JSONException {
146119 if (this .expires == 0 ) {
147120 this .expires = 3600 ; // 3600s, default.
0 commit comments