com.google.api.services.drive.model.File.setId()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(118)

本文整理了Java中com.google.api.services.drive.model.File.setId()方法的一些代码示例,展示了File.setId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。File.setId()方法的具体详情如下:
包路径:com.google.api.services.drive.model.File
类名称:File
方法名:setId

File.setId介绍

[英]The ID of the file.
[中]文件的ID。

代码示例

代码示例来源:origin: apache/incubator-gobblin

private FileList createFileList(java.util.List<String> fileIds, String folderId) {
  FileList fileList = new FileList();
  java.util.List<File> list = Lists.newArrayList();
  for (String fileId : fileIds) {
   File f = new File();
   f.setId(fileId);
   f.setModifiedTime(new DateTime(System.currentTimeMillis()));
   list.add(f);
  }

  if (folderId != null) {
   File f = new File();
   f.setMimeType(FOLDER_MIME_TYPE);
   f.setId(folderId);
   f.setModifiedTime(new DateTime(System.currentTimeMillis()));
   list.add(f);
  }
  fileList.setFiles(list);
  return fileList;
 }
}

代码示例来源:origin: apache/incubator-gobblin

final MutableInt i = new MutableInt(paginatedCalls);
final File file = new File();
file.setId("testId");
file.setModifiedTime(new DateTime(System.currentTimeMillis()));

代码示例来源:origin: RoboZonky/robozonky

public CopyFileResponseHandler(final File source) {
  this(source, source.clone());
  target.setId(UUID.randomUUID().toString());
}

代码示例来源:origin: RoboZonky/robozonky

public static File getFile(final String name, final String id) {
  final File result = new File();
  result.setId(id);
  result.setMimeType("application/vnd.google-apps.files");
  result.setName(name);
  result.setModifiedTime(new DateTime(System.currentTimeMillis()));
  return result;
}

相关文章