public class OSSClient extends Object
Constructor and Description |
---|
OSSClient() |
Modifier and Type | Method and Description |
---|---|
static File |
getDataDir() |
static DocumentBuilderFactory |
getDomBuilderFact()
获取一个dom构造器
|
static ExecutorService |
getExecutorService()
获取属于OSSClient的线程池
|
static AccessControlList |
getGlobalDefaultACL() |
static String |
getGlobalDefaultHostId()
取得设置的hostid
|
static TokenGenerator |
getGlobalDefaultTokenGenerator() |
static long |
getStandardEpochTimeInSecond() |
static void |
setApplicationContext(android.content.Context ctx)
为OSSClient传入应用程序的context
必须是applicatContext,全局范围内只需要设置一次
|
static void |
setCustomStandardTimeWithEpochSec(long currentEpochTimeInSec)
如果担心手机终端系统时间不准,可以用这个接口设置从服务器拿到的时间。
如果进行了设置,后续加签将以这个时间为准。
否则,默认使用当前手机系统时间。
|
static void |
setGlobalDefaultACL(AccessControlList globalDefaultACL)
为OSSClient设置一个全局默认的bucket访问权限,它可以被后续bucket的设置继承或覆盖
如果从不调用此接口,ACL在初始化时被设置为private
|
static void |
setGlobalDefaultHostId(String hostId)
设置后续操作所用bucket所在的数据中心的全局默认hostId, 它可以被后续bucket的设置继承或覆盖
如果从不调用此接口,hostId在初始化时被设置为'oss-cn-hangzhou.aliyuncs.com'
|
static void |
setGlobalDefaultTokenGenerator(TokenGenerator tokenGen)
为OSSclient设置一个全局默认加签器,它可以被后续bucket的设置继承或覆盖
|
public static void setGlobalDefaultTokenGenerator(TokenGenerator tokenGen)
tokenGen
- public static TokenGenerator getGlobalDefaultTokenGenerator()
public static void setGlobalDefaultACL(AccessControlList globalDefaultACL)
globalDefaultACL
- public static AccessControlList getGlobalDefaultACL()
public static void setCustomStandardTimeWithEpochSec(long currentEpochTimeInSec)
currentEpochTimeInSec
- public static long getStandardEpochTimeInSecond()
public static void setGlobalDefaultHostId(String hostId)
hostId
- public static String getGlobalDefaultHostId()
public static void setApplicationContext(android.content.Context ctx)
ctx
- public static File getDataDir()
public static DocumentBuilderFactory getDomBuilderFact()
public static ExecutorService getExecutorService()
Copyright © 2015. All rights reserved.