refactoring

pull/1/head
Michael Peter Christen 13 years ago
parent 4aa0eedead
commit f5efdb21fd

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

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

Loading…
Cancel
Save