use of org.gradle.internal.resource.metadata.ExternalResourceMetaData in project gradle by gradle.
the class BuildOperationExternalResource method createBuildOperationDetails.
private BuildOperationDetails createBuildOperationDetails() {
ExternalResourceMetaData metaData = getMetaData();
DownloadBuildOperationDescriptor downloadBuildOperationDescriptor = new DownloadBuildOperationDescriptor(metaData.getLocation(), metaData.getContentLength(), metaData.getContentType());
BuildOperationDetails buildOperationDetails = BuildOperationDetails.displayName("Download " + metaData.getLocation().toString()).parent(buildOperationExecutor.getCurrentOperation()).operationDescriptor(downloadBuildOperationDescriptor).build();
return buildOperationDetails;
}
use of org.gradle.internal.resource.metadata.ExternalResourceMetaData in project gradle by gradle.
the class HttpResourceAccessor method getMetaData.
public ExternalResourceMetaData getMetaData(URI uri, boolean revalidate) {
String location = uri.toString();
LOGGER.debug("Constructing external resource metadata: {}", location);
CloseableHttpResponse response = http.performHead(location, revalidate);
ExternalResourceMetaData result = null;
if (response != null) {
HttpResponseResource resource = new HttpResponseResource("HEAD", uri, response);
try {
result = resource.getMetaData();
} finally {
IoActions.closeQuietly(resource);
}
}
return result;
}
Aggregations