Package com.qiniu.storage.model
Class BucketReferAntiLeech
- java.lang.Object
-
- com.qiniu.storage.model.BucketReferAntiLeech
-
public class BucketReferAntiLeech extends java.lang.Object空间referer配置
-
-
Constructor Summary
Constructors Constructor Description BucketReferAntiLeech()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BucketReferAntiLeechaddPattern(java.lang.String pattern)追加pattern
patternjava.lang.StringasQueryString()编码成query参数格式BucketReferAntiLeechsetAllowEmptyReferer(boolean allowEmptyReferer)设置是否允许空 referer,默认为 trueBucketReferAntiLeechsetMode(int mode)设置防盗链模式, 0 - 关闭Refer防盗链, 1 - 开启Referer白名单,2 - 开启Referer黑名单BucketReferAntiLeechsetPattern(java.lang.String pattern)设置 pattern
pattern 不可为空
当前允许的匹配字符串格式分为三种: foo.com、*.foo.com、*,用;隔开
-
-
-
Method Detail
-
setMode
public BucketReferAntiLeech setMode(int mode) throws java.lang.Exception
设置防盗链模式, 0 - 关闭Refer防盗链, 1 - 开启Referer白名单,2 - 开启Referer黑名单- Parameters:
mode- 防盗链模式- Returns:
- 防盗链信息
- Throws:
java.lang.Exception- 异常
-
setAllowEmptyReferer
public BucketReferAntiLeech setAllowEmptyReferer(boolean allowEmptyReferer)
设置是否允许空 referer,默认为 true- Parameters:
allowEmptyReferer- 是否允许空 设置是否允许空referer- Returns:
- 防盗链信息
-
setPattern
public BucketReferAntiLeech setPattern(java.lang.String pattern) throws java.lang.Exception
设置 pattern
pattern 不可为空
当前允许的匹配字符串格式分为三种: foo.com、*.foo.com、*,用;隔开- Parameters:
pattern- 防盗链匹配规则- Returns:
- 防盗链信息
- Throws:
java.lang.Exception- 异常
-
addPattern
public BucketReferAntiLeech addPattern(java.lang.String pattern) throws java.lang.Exception
追加pattern
pattern- Parameters:
pattern- 防盗链匹配规则- Returns:
- 防盗链信息
- Throws:
java.lang.Exception- 异常
-
asQueryString
public java.lang.String asQueryString()
编码成query参数格式- Returns:
- query
-
-