refactoring

This commit is contained in:
Michael Peter Christen 2012-04-24 12:54:41 +02:00
parent 4aa0eedead
commit f5efdb21fd
2 changed files with 5 additions and 9 deletions

View File

@ -172,10 +172,6 @@ public final class Cache {
* @param url the url of the resource
* @return true if the content of the url is in the cache, false otherwise
*/
public static boolean has(final DigestURI url) {
return has(url.hash());
}
public static boolean has(final byte[] urlhash) {
boolean headerExists;
boolean fileExists;
@ -254,12 +250,12 @@ public final class Cache {
* @param url
* @throws IOException
*/
public static void delete(final DigestURI url) throws IOException {
public static void delete(final byte[] hash) throws IOException {
if (responseHeaderDB instanceof MapHeap) {
((MapHeap) responseHeaderDB).delete(url.hash());
((MapHeap) responseHeaderDB).delete(hash);
} else {
responseHeaderDB.remove(url.hash());
responseHeaderDB.remove(hash);
}
fileDB.delete(url.hash());
fileDB.delete(hash);
}
}

View File

@ -502,7 +502,7 @@ public final class HTTPDProxyHandler {
final byte[] b = Cache.getContent(url.hash());
if (b != null) sizeBeforeDelete = b.length;
}
Cache.delete(url);
Cache.delete(url.hash());
conProp.put(HeaderFramework.CONNECTION_PROP_PROXY_RESPOND_CODE, "TCP_REFRESH_MISS");
}