ArcResource ar = (ArcResource)
ResourceFactory.ARCArchiveRecordToResource(r, null);
if(ar.getStatusCode() == 502) {
throw new LiveDocumentNotAvailableException(urlString);
} else if(ar.getStatusCode() == 504) {
throw new LiveWebTimeoutException("Timeout:" + urlString);
}
success = true;
return ar;
} else {
throw new LiveWebCacheUnavailableException(urlString);
}
} catch (ResourceNotAvailableException e) {
throw new LiveDocumentNotAvailableException(urlString);
} catch (NoHttpResponseException e) {
throw new LiveWebCacheUnavailableException("No Http Response for "
+ urlString);
} catch (ConnectException e) {
throw new LiveWebCacheUnavailableException(e.getLocalizedMessage()
+ " : " + urlString);
} catch (SocketException e) {
throw new LiveWebCacheUnavailableException(e.getLocalizedMessage()
+ " : " + urlString);
} catch (SocketTimeoutException e) {
throw new LiveWebTimeoutException(e.getLocalizedMessage()
+ " : " + urlString);
} catch(ConnectTimeoutException e) {
throw new LiveWebTimeoutException(e.getLocalizedMessage()
+ " : " + urlString);
} finally {
if (!success) {
method.abort();
}