Skip to content

Commit

Permalink
Refactor createDrivePhoto
Browse files Browse the repository at this point in the history
  • Loading branch information
huangsam committed Dec 17, 2024
1 parent cd5bd89 commit e206e4d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ private void createDrivePhoto(String folderId, @NotNull Photo photo) throws IOEx
return;
}

File photoMetadata = new File();
photoMetadata.setName(photo.name());
photoMetadata.setParents(List.of(folderId));

String contentType = Files.probeContentType(photo.path());
if (contentType == null) {
failureCount++;
return;
}

File photoMetadata = new File();
photoMetadata.setName(photo.name());
photoMetadata.setParents(List.of(folderId));

java.io.File photoFile = new java.io.File(photo.path().toString());
FileContent photoContent = new FileContent(contentType, photoFile);

Expand Down

0 comments on commit e206e4d

Please sign in to comment.