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


Java About类代码示例

本文整理汇总了Java中com.google.api.services.drive.model.About的典型用法代码示例。如果您正苦于以下问题:Java About类的具体用法?Java About怎么用?Java About使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


About类属于com.google.api.services.drive.model包,在下文中一共展示了About类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: makedir

import com.google.api.services.drive.model.About; //导入依赖的package包/类
@Override
public void makedir(String path) throws IOException {

    //Obtain the root id
    if (rootId.equals("")) {
        try {
            About about;
            about = service.about().get().execute();
            rootId = about.getRootFolderId();
        } catch (IOException ex) {
            Logger.getLogger(GoogleDriveClient.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    mkDirs(path, rootId);

}
 
开发者ID:modcs,项目名称:caboclo,代码行数:18,代码来源:GoogleDriveClient.java

示例2: testValidate

import com.google.api.services.drive.model.About; //导入依赖的package包/类
@Test
public void testValidate() throws Exception {
    dataSource.initialize(container, inputProperties);
    assertEquals(Result.ERROR, dataSource.validate(container).getStatus());

    dataSource = spy(dataSource);
    Drive drive = mock(Drive.class, RETURNS_DEEP_STUBS);
    GoogleDriveUtils utils = mock(GoogleDriveUtils.class, RETURNS_DEEP_STUBS);
    doReturn(drive).when(dataSource).getDriveService();
    doReturn(utils).when(dataSource).getDriveUtils();
    inputProperties.getDatasetProperties().getDatastoreProperties().serviceAccountJSONFile.setValue("service.json");
    dataSource.initialize(container, inputProperties);

    About about = new About();
    User user = new User();
    user.setEmailAddress("[email protected]");
    about.setUser(user);
    when(drive.about().get().setFields(anyString()).execute()).thenReturn(about);
    assertEquals(Result.OK, dataSource.validate(container).getStatus());
}
 
开发者ID:Talend,项目名称:components,代码行数:21,代码来源:GoogleDriveDataSourceTest.java

示例3: finishInitialization

import com.google.api.services.drive.model.About; //导入依赖的package包/类
private void finishInitialization(AccountData newAccountData, String accountName) throws IOException
{
	
	if (TextUtils.isEmpty(newAccountData.mRootFolderId))
	{
		logDebug("Finish init account for " + accountName);
		About about = newAccountData.drive.about().get().execute();
		newAccountData.mRootFolderId = about.getRootFolderId();
	}
	else
	{
		logDebug("Account for " + accountName + " already fully initialized.");
	}
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:15,代码来源:GoogleDriveFileStorage.java

示例4: get

import com.google.api.services.drive.model.About; //导入依赖的package包/类
@Override
public Space get() throws BackgroundException {
    try {
        final About about = session.getClient().about().get().setFields("user, storageQuota").execute();
        final Long used = null == about.getStorageQuota().getUsage() ? 0L
            : about.getStorageQuota().getUsage();
        final Long available = null == about.getStorageQuota().getLimit() ? Long.MAX_VALUE
            : about.getStorageQuota().getLimit() - used;
        return new Space(used, available);
    }
    catch(IOException e) {
        throw new DriveExceptionMappingService().map("Failure to read attributes of {0}", e,
            new Path(String.valueOf(Path.DELIMITER), EnumSet.of(Path.Type.volume, Path.Type.directory)));
    }
}
 
开发者ID:iterate-ch,项目名称:cyberduck,代码行数:16,代码来源:DriveQuotaFeature.java

示例5: testValidateConnection

import com.google.api.services.drive.model.About; //导入依赖的package包/类
@Test
public void testValidateConnection() throws Exception {
    About about = new About();
    User user = new User();
    user.setEmailAddress("te[email protected]");
    about.setUser(user);
    when(drive.about().get().setFields(anyString()).execute()).thenReturn(about);
    assertEquals(Result.OK, testRuntime.validateConnection(testRuntime.getConnectionProperties()).getStatus());
}
 
开发者ID:Talend,项目名称:components,代码行数:10,代码来源:GoogleDriveRuntimeTest.java

示例6: getRootFolderID

import com.google.api.services.drive.model.About; //导入依赖的package包/类
protected String getRootFolderID() throws IOException {
    if ((drive != null) && (rootFolderId == null)) {
        About aAbout = drive.about().get().execute();
        rootFolderId = aAbout.get("rootFolderId").toString();
    }
    return rootFolderId;
}
 
开发者ID:acxio,项目名称:AGIA,代码行数:8,代码来源:GoogleDriveServiceImpl.java

示例7: performInitialSync

import com.google.api.services.drive.model.About; //导入依赖的package包/类
/**
 * Performs initial sync.
 */
private void performInitialSync() throws IOException {

  // Get the largest change id first to avoid race conditions
  About about = drive.about().get().setFields(ABOUT_GET_FIELDS).execute();
  long largestChangeId = about.getLargestChangeId();

  // Get all the KML/KMZ files in the "My Drive:/My Tracks" folder
  Files.List myTracksFolderRequest = drive.files()
      .list().setQ(String.format(Locale.US, SyncUtils.MY_TRACKS_FOLDER_FILES_QUERY, folderId));
  Map<String, File> myTracksFolderMap = getFiles(myTracksFolderRequest, true);

  // Handle tracks that are already uploaded to Google Drive
  Set<String> syncedDriveIds = updateSyncedTracks();
  for (String driveId : syncedDriveIds) {
    myTracksFolderMap.remove(driveId);
  }

  // Get all the KML/KMZ files in the "Shared with me:/" folder
  Files.List sharedWithMeRequest = drive.files()
      .list().setQ(SyncUtils.SHARED_WITH_ME_FILES_QUERY);
  Map<String, File> sharedWithMeMap = getFiles(sharedWithMeRequest, false);

  try {
    insertNewTracks(myTracksFolderMap.values());
    insertNewTracks(sharedWithMeMap.values());
    PreferencesUtils.setLong(context, R.string.drive_largest_change_id_key, largestChangeId);
  } catch (IOException e) {

    // Remove all imported tracks
    Cursor cursor = null;
    try {
      cursor = myTracksProviderUtils.getTrackCursor(SyncUtils.DRIVE_ID_TRACKS_QUERY, null, null);
      if (cursor != null && cursor.moveToFirst()) {
        do {
          Track track = myTracksProviderUtils.createTrack(cursor);
          if (!syncedDriveIds.contains(track.getDriveId())) {
            myTracksProviderUtils.deleteTrack(context, track.getId());
          }
        } while (cursor.moveToNext());
      }
    } finally {
      if (cursor != null) {
        cursor.close();
      }
    }
    throw e;
  }
}
 
开发者ID:Plonk42,项目名称:mytracks,代码行数:52,代码来源:SyncAdapter.java

示例8: getAuthenticatedUser

import com.google.api.services.drive.model.About; //导入依赖的package包/类
private UserInfo getAuthenticatedUser(Drive drive, IProgressMonitor monitor) throws IOException {
	SubMonitor subMonitor = SubMonitor.convert(monitor);
	About about = drive.about().get().execute();
	User user = about.getUser();
	return new UserInfo(user.getEmailAddress(), user.getDisplayName());
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:7,代码来源:GDriveConnectionManager.java

示例9: BasicInfo

import com.google.api.services.drive.model.About; //导入依赖的package包/类
public BasicInfo(About about) {
    largestChangeId = about.getLargestChangeId();
    rootFolderId = about.getRootFolderId();
}
 
开发者ID:stepank,项目名称:jdbox,代码行数:5,代码来源:DriveAdapter.java


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