throws LiveDocumentNotAvailableException, IOException {
Resource resource = null;
LOGGER.info("Caching URL(" + url.toString() + ")");
ARCLocation location = null;
try {
location = cacher.cache(arcCacheDir, url.toString());
} catch(LiveDocumentNotAvailableException e) {
// record the failure, so we can fail early next time:
SearchResult result = forgeFailedSearchResult(url);
index.addSearchResult(result);
LOGGER.info("Added FAIL-URL(" + url.toString() + ") to LiveIndex");
throw e;
}
if(location != null) {
String name = location.getName();
long offset = location.getOffset();
LOGGER.info("Cached URL(" + url.toString() + ") in " +
"ARC(" + name + ") at (" + offset + ")");
resource = arcCacheDir.getResource(name, offset);
// add the result to the index:
if(resource instanceof ArcResource) {