Skip to content

Commit

Permalink
create file it none exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Balcaen committed Apr 3, 2024
1 parent 9226a22 commit 8001181
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public File getObjectAsFile(String key) {
try {
ResponseBytes<GetObjectResponse> objectBytes = getObjectResponseBytes(key);
final var file = new File("/tmp/"+key);
if (file.exists()) {
file.delete();
}
file.createNewFile();
OutputStream os = new FileOutputStream(file);
os.write(objectBytes.asByteArray());
os.close();
Expand Down

0 comments on commit 8001181

Please sign in to comment.