}
public AssetWithContent retrieve(java.net.URI uri, boolean isRoot)
{
AssetWithContent result = null;
// PRECONDITIONS
assert uri != null : "uri must not be null.";
// Body
try
{
Asset asset = null;
GetMethod get = null;
Map<String, String> headers = null;
int statusCode = -1;
Date start = null;
Date end = null;
String reportedMimeType = null;
log.info("HTTP GET " + uri);
get = new GetMethod(uri.toString());
start = new Date();
statusCode = httpClient.executeMethod(get);
end = new Date();
headers = buildHeaderMap(get);
reportedMimeType = headers.get(HEADER_NAME_MIME_TYPE);
asset = assetFactory.create(uri, isRoot);
asset.setHeaders(buildHeaderMap(get));
asset.setRetrievalTimeInMs(end.getTime() - start.getTime());
asset.setStatusCode(statusCode);
asset.setReportedMimeType(reportedMimeType);
//####TODO: Set other stuff here
result = new AssetWithContent(asset, get.getResponseBodyAsStream());
}
catch (RuntimeException re)
{
throw re;
}