From 630a955674d78642db2f4eed59bafda3de1504c3 Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 2 Oct 2006 17:18:24 +0000 Subject: [PATCH] read snippets from cache in case they are not provided in RAM git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2700 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/plasma/plasmaSnippetCache.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/de/anomic/plasma/plasmaSnippetCache.java b/source/de/anomic/plasma/plasmaSnippetCache.java index fc057ecde..d2a1f6864 100644 --- a/source/de/anomic/plasma/plasmaSnippetCache.java +++ b/source/de/anomic/plasma/plasmaSnippetCache.java @@ -201,11 +201,15 @@ public class plasmaSnippetCache { // getting resource metadata (e.g. the http headers for http resources) if (entry != null) docInfo = entry.getDocumentInfo(); - // read resource body + // read resource body (if it is there) resource = entry.cacheArray(); - if (resource == null) { - return new Snippet(null, ERROR_RESOURCE_LOADING, "error loading resource, plasmaHTCache.Entry cache is NULL"); - } + + // in case that the reosurce was not in ram, read it from disk + if (resource == null) resource = this.cacheManager.loadResourceContent(url); + + // if it is still not available, throw exception + if (resource == null) return new Snippet(null, ERROR_RESOURCE_LOADING, "error loading resource, plasmaHTCache.Entry cache is NULL"); + source = SOURCE_WEB; } } catch (Exception e) {