Skip to content

Commit

Permalink
chore(refactor): remove deprecated StorageInterface method
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Jan 11, 2024
1 parent 97b7af5 commit 98d1b18
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions src/main/java/io/kestra/storage/s3/S3Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,36 +134,6 @@ private Stream<String> keysForPrefix(String prefix, boolean recursive, boolean i
});
}

@Override
public Long size(String tenantId, URI uri) throws IOException {
try {
HeadObjectRequest headObjectRequest = HeadObjectRequest.builder()
.bucket(s3Config.getBucket())
.key(getPath(tenantId, uri))
.build();
return s3Client.headObject(headObjectRequest).contentLength();
} catch (NoSuchKeyException exception) {
throw new FileNotFoundException();
} catch (AwsServiceException exception) {
throw new IOException(exception);
}
}

@Override
public Long lastModifiedTime(String tenantId, URI uri) throws IOException {
try {
HeadObjectRequest headObjectRequest = HeadObjectRequest.builder()
.bucket(s3Config.getBucket())
.key(getPath(tenantId, uri))
.build();
return s3Client.headObject(headObjectRequest).lastModified().getEpochSecond();
} catch (NoSuchKeyException exception) {
throw new FileNotFoundException();
} catch (AwsServiceException exception) {
throw new IOException(exception);
}
}

@Override
public FileAttributes getAttributes(String tenantId, URI uri) throws IOException {
String path = getPath(tenantId, uri);
Expand Down

0 comments on commit 98d1b18

Please sign in to comment.