use of org.gradle.internal.resource.transfer.ExternalResourceReadResponse in project gradle by gradle.
the class HttpResourceLister method list.
public List<String> list(final URI directory) {
final ExternalResourceReadResponse response = accessor.openResource(directory, true);
if (response == null) {
return null;
}
try {
try {
String contentType = response.getMetaData().getContentType();
ApacheDirectoryListingParser directoryListingParser = new ApacheDirectoryListingParser();
InputStream inputStream = response.openStream();
try {
return directoryListingParser.parse(directory, inputStream, contentType);
} catch (Exception e) {
throw new ResourceException(directory, String.format("Unable to parse HTTP directory listing for '%s'.", directory), e);
}
} finally {
response.close();
}
} catch (IOException e) {
throw ResourceExceptions.getFailed(directory, e);
}
}
Aggregations