Jav Google Drive !!hot!! Link

Note: Files created by a service account are owned by that account. To access team/shared drives, grant the service account’s email access in Google Drive. (Desktop/Web app) You’ll need to store/refresh credentials using AuthorizationCodeFlow . For a quick test, use GoogleAuthorizationCodeTokenRequest and save the refresh token. 4. Common Operations Upload a file File fileMetadata = new File(); fileMetadata.setName("myfile.txt"); fileMetadata.setParents(Collections.singletonList("root")); FileContent mediaContent = new FileContent("text/plain", new java.io.File("local/path.txt"));

File uploadedFile = driveService.files().create(fileMetadata, mediaContent) .setFields("id") .execute(); System.out.println("File ID: " + uploadedFile.getId()); String fileId = "abc123..."; OutputStream out = new FileOutputStream("downloaded.txt"); driveService.files().get(fileId).executeMediaAndDownloadTo(out); List files FileList result = driveService.files().list() .setPageSize(10) .setFields("nextPageToken, files(id, name, mimeType)") .execute(); for (File f : result.getFiles()) System.out.printf("%s (%s)\n", f.getName(), f.getId()); jav google drive

Sign up for our updates

CLICK HERE TO SIGN UP You can be assured that we will not share your information. (Please check your spam and add us to your contacts if you are not receiving emails.)  

Success!