이 코드는 Google 드라이브에있는 파일의 ID를 식별하는 데 도움이 될 수 있습니다.
public static void main(String[] args) throws IOException {
// Build a new authorized API client service.
Drive service = getDriveService();
// Print the names and IDs for up to 10 files.
FileList result = service.files().list()
.setMaxResults(10)
.execute();
List<File> files = result.getItems();
if (files == null || files.size() == 0) {
System.out.println("No files found.");
} else {
System.out.println("Files:");
for (File file : files) {
System.out.printf("%s (%s)\n", file.getTitle(), file.getId());
}
}
}
감사합니다.하지만이 동기화 방법을 제안 할 수 있습니까? –
들어요, 내 파일이 드라이브에 만들어 졌는데 봤어요. 이미 동기화 된 파일을 의미합니까? –
동기화 할 작업이 없어도 자동으로 수행됩니다. resourceId를 추가하는 등 변경 이벤트를 수신하여 리소스가 언제 변경되는지 확인할 수 있습니다. https://developers.google.com/drive/android/events –