本文整理汇总了Java中com.google.api.client.auth.oauth2.StoredCredential.getDefaultDataStore方法的典型用法代码示例。如果您正苦于以下问题:Java StoredCredential.getDefaultDataStore方法的具体用法?Java StoredCredential.getDefaultDataStore怎么用?Java StoredCredential.getDefaultDataStore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.api.client.auth.oauth2.StoredCredential
的用法示例。
在下文中一共展示了StoredCredential.getDefaultDataStore方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDataStore
import com.google.api.client.auth.oauth2.StoredCredential; //导入方法依赖的package包/类
public static DataStore<StoredCredential> getDataStore()
throws IOException
{
AppEngineDataStoreFactory factory = AppEngineDataStoreFactory.getDefaultInstance();
return StoredCredential.getDefaultDataStore( factory );
}
示例2: getDataStore
import com.google.api.client.auth.oauth2.StoredCredential; //导入方法依赖的package包/类
public static DataStore<StoredCredential> getDataStore()
throws IOException
{
AppEngineDataStoreFactory factory = AppEngineDataStoreFactory.getDefaultInstance();
return StoredCredential.getDefaultDataStore( factory );
}
示例3: FileCredentialStore
import com.google.api.client.auth.oauth2.StoredCredential; //导入方法依赖的package包/类
public FileCredentialStore(File file) throws IOException {
dsf = new FileDataStoreFactory( file );
db = StoredCredential.getDefaultDataStore( dsf );
}
示例4: MemoryCredentialStore
import com.google.api.client.auth.oauth2.StoredCredential; //导入方法依赖的package包/类
public MemoryCredentialStore() throws IOException {
dsf = MemoryDataStoreFactory.getDefaultInstance();
db = StoredCredential.getDefaultDataStore( dsf );
}
示例5: removeCredential
import com.google.api.client.auth.oauth2.StoredCredential; //导入方法依赖的package包/类
/**
* Deletes the stored credentials for the given account id. This means the
* next time the user must authorize the app to access his calendars.
*
* @param accountId
* The identifier of the account.
*/
synchronized void removeCredential(String accountId) throws IOException {
DataStore<StoredCredential> sc = StoredCredential.getDefaultDataStore(dataStoreFactory);
sc.delete(accountId);
calendarService = null;
geoService = null;
}
示例6: isAuthorized
import com.google.api.client.auth.oauth2.StoredCredential; //导入方法依赖的package包/类
/**
* Checks if the given account id has already been authorized and the
* user granted access to his calendars info.
*
* @param accountId
* The identifier of the account used internally by the application.
* @return {@code true} if the account has already been set up, otherwise
* {@code false}.
*/
boolean isAuthorized(String accountId) {
try {
DataStore<StoredCredential> sc = StoredCredential.getDefaultDataStore(dataStoreFactory);
return sc.containsKey(accountId);
} catch (IOException e) {
return false;
}
}