当前位置: 首页>>代码示例>>Java>>正文


Java StoredCredential.getDefaultDataStore方法代码示例

本文整理汇总了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 );
}
 
开发者ID:pthakkar9,项目名称:mirror-api-book-chap3,代码行数:7,代码来源:AuthUtils.java

示例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 );
}
 
开发者ID:ipool,项目名称:GlassPool,代码行数:7,代码来源:AuthUtil.java

示例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 );
}
 
开发者ID:icoretech,项目名称:audiobox-jlib,代码行数:5,代码来源:FileCredentialStore.java

示例4: MemoryCredentialStore

import com.google.api.client.auth.oauth2.StoredCredential; //导入方法依赖的package包/类
public MemoryCredentialStore() throws IOException {
  dsf = MemoryDataStoreFactory.getDefaultInstance();
  db = StoredCredential.getDefaultDataStore( dsf );
}
 
开发者ID:icoretech,项目名称:audiobox-jlib,代码行数:5,代码来源:MemoryCredentialStore.java

示例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;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:14,代码来源:GoogleConnector.java

示例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;
    }
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:18,代码来源:GoogleConnector.java


注:本文中的com.google.api.client.auth.oauth2.StoredCredential.getDefaultDataStore方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。