@@ -41,38 +41,17 @@ public class PutPolicy {
41
41
public int detectMime ;
42
42
/** 可选 */
43
43
public long fsizeLimit ;
44
- /**限定用户上传的文件类型
44
+ /**限定用户上传的文件类型
45
45
* 可选
46
46
* */
47
47
public String mimeLimit ;
48
48
/** 可选 */
49
49
public String persistentNotifyUrl ;
50
50
/** 可选 */
51
51
public String persistentOps ;
52
-
53
- private long deadline ;
54
52
55
- /**
56
- *
57
- * 对文件先进行一次变换操作(比如将音频统一转为某种码率的mp3)再进行存储。
58
- * transform的值就是一个fop指令,比如 "avthumb/mp3"。其含义是对上传的文件
59
- * 执行这个 fop 指令,然后把结果保存到七牛。最后保存的是经过处理过的文件,
60
- * 而不是用户上传的原始文件。
61
- *
62
- **/
63
- public String transform ;
53
+ private long deadline ;
64
54
65
- /**
66
- *
67
- * 单位: 秒
68
- * 文件变换操作执行的超时时间(单位:秒),上传和转码操作是同步进行的,
69
- * 先上传后转码,这个时间只是转码所需时间,不包括上传文件所需时间。
70
- * 这个值太小可能会导致误判(最终存储成功了但客户端得到超时的错误),
71
- * 但太大可能会导致服务端将其判断为低优先级任务。建议取一个相对准确的
72
- * 时间估计值*N(N不要超过5)。
73
- *
74
- **/
75
- public long fopTimeout ;
76
55
77
56
public PutPolicy (String scope ) {
78
57
this .scope = scope ;
@@ -121,27 +100,21 @@ public String marshal() throws JSONException {
121
100
if (this .persistentOps != null && this .persistentOps .length () > 0 ) {
122
101
stringer .key ("persistentOps" ).value (this .persistentOps );
123
102
}
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
- }
130
103
stringer .key ("deadline" ).value (this .deadline );
131
104
stringer .endObject ();
132
105
133
106
return stringer .toString ();
134
107
}
135
108
136
-
109
+
137
110
/**
138
111
* makes an upload token.
139
112
* @param mac
140
113
* @return
141
114
* @throws AuthException
142
115
* @throws JSONException
143
116
*/
144
-
117
+
145
118
public String token (Mac mac ) throws AuthException , JSONException {
146
119
if (this .expires == 0 ) {
147
120
this .expires = 3600 ; // 3600s, default.
0 commit comments