本文整理了Java中com.google.api.services.drive.Drive.about()
方法的一些代码示例,展示了Drive.about()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Drive.about()
方法的具体详情如下:
包路径:com.google.api.services.drive.Drive
类名称:Drive
方法名:about
[英]An accessor for creating requests from the About collection.
The typical use is:
Drive drive = new Drive(...); Drive.About.List request = drive.about().list(parameters ...)
[中]用于从About集合创建请求的访问器。
典型用途是:
Drive drive = new Drive(...); Drive.About.List request = drive.about().list(parameters ...)
代码示例来源:origin: org.talend.components/components-googledrive-runtime
@Override
public ValidationResult validate(RuntimeContainer container) {
ValidationResult vr = new ValidationResultMutable(Result.OK);
// check for Connection attributes
if (StringUtils.isEmpty(serviceAccountFile)) {
vr = new ValidationResultMutable(Result.ERROR).setMessage("Service Account JSON File cannot be empty.");
return vr;
}
try {
// make a dummy call to check drive's connection..
User u = getDriveService().about().get().setFields("user").execute().getUser();
LOG.debug("[validate] Testing User Properties: {}.", u);
} catch (Exception ex) {
LOG.error("[validate] {}.", ex.getMessage());
vr = new ValidationResultMutable(Result.ERROR).setMessage(ex.getMessage());
return vr;
}
return ValidationResult.OK;
}
代码示例来源:origin: Talend/components
@Override
public ValidationResult validate(RuntimeContainer container) {
ValidationResult vr = new ValidationResultMutable(Result.OK);
// check for Connection attributes
if (StringUtils.isEmpty(serviceAccountFile)) {
vr = new ValidationResultMutable(Result.ERROR).setMessage("Service Account JSON File cannot be empty.");
return vr;
}
try {
// make a dummy call to check drive's connection..
User u = getDriveService().about().get().setFields("user").execute().getUser();
LOG.debug("[validate] Testing User Properties: {}.", u);
} catch (Exception ex) {
LOG.error("[validate] {}.", ex.getMessage());
vr = new ValidationResultMutable(Result.ERROR).setMessage(ex.getMessage());
return vr;
}
return ValidationResult.OK;
}
代码示例来源:origin: qaprosoft/zafira
@Override
@SuppressWarnings("all")
public boolean isConnected()
{
boolean result = false;
try
{
File file = new File(CLIENT_SECRET_JSON);
if(file.exists())
{
driveAuthService.getService(getContext().getCredsFile()).about();
sheetsAuthService.getService(getContext().getCredsFile()).spreadsheets();
result = true;
}
} catch(Exception e)
{
}
return result;
}
代码示例来源:origin: org.talend.components/components-googledrive-runtime
public String call() throws Exception {
// make a dummy call to check drive's connection...
User u = getDriveService().about().get().setFields("user").execute().getUser();
return u.toPrettyString();
}
});
代码示例来源:origin: Talend/components
public String call() throws Exception {
// make a dummy call to check drive's connection...
User u = getDriveService().about().get().setFields("user").execute().getUser();
return u.toPrettyString();
}
});
代码示例来源:origin: iterate-ch/cyberduck
@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)));
}
}
}
内容来源于网络,如有侵权,请联系作者删除!