use of org.gradle.internal.resource.metadata.DefaultExternalResourceMetaData in project gradle by gradle.
the class S3ResourceConnector method getMetaData.
@Override
public ExternalResourceMetaData getMetaData(ExternalResourceName location, boolean revalidate) {
LOGGER.debug("Attempting to get resource metadata: {}", location);
S3Object s3Object = s3Client.getMetaData(location.getUri());
if (s3Object == null) {
return null;
}
try {
ObjectMetadata objectMetadata = s3Object.getObjectMetadata();
return new DefaultExternalResourceMetaData(location.getUri(), objectMetadata.getLastModified().getTime(), objectMetadata.getContentLength(), objectMetadata.getContentType(), objectMetadata.getETag(), // Passing null for sha1 - TODO - consider using the etag which is an MD5 hash of the file (when less than 5Gb)
null);
} finally {
discardEmptyContentAndClose(s3Object);
}
}
use of org.gradle.internal.resource.metadata.DefaultExternalResourceMetaData in project gradle by gradle.
the class S3Resource method getMetaData.
@Override
public ExternalResourceMetaData getMetaData() {
ObjectMetadata objectMetadata = s3Object.getObjectMetadata();
Date lastModified = objectMetadata.getLastModified();
return new DefaultExternalResourceMetaData(uri, lastModified.getTime(), getContentLength(), s3Object.getObjectMetadata().getContentType(), s3Object.getObjectMetadata().getETag(), // Passing null for sha1 - TODO - consider using the etag which is an MD5 hash of the file (when less than 5Gb)
null);
}
Aggregations