1 package org.jahia.clipbuilder.html.web.Url; 2 3 import java.util.*; 4 5 10 public class URLMap { 11 12 private Hashtable map = new Hashtable(); 13 private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(URLMap.class); 14 15 16 19 public URLMap() { 20 } 21 22 23 29 public URLWrapper getSourceUrl(String key) { 30 logger.debug("get url whit key: " + key); 31 Object o = map.get(key); 32 if (o == null) { 33 logger.warn("[ No value found for key = " + key + " ]"); 34 } 35 return (URLWrapper) map.get(key); 36 } 37 38 39 45 public void addSourceUrl(URLWrapper uw, String hash) { 46 logger.debug("add url wrapper " + uw.getSourceUrl() + "whit key: " + hash); 47 map.put(hash, uw); 48 } 49 50 51 54 public void debug_EnumerateKey() { 55 logger.debug("Start-debug_EnumerateKey"); 56 Enumeration enu = map.keys(); 57 while (enu.hasMoreElements()) { 58 String key = (String ) enu.nextElement(); 59 logger.debug("find key: " + key); 60 } 61 logger.debug("End-debug_EnumerateKey"); 62 } 63 64 65 68 public void reset() { 69 map = new Hashtable(); 70 } 71 72 } 73 | Popular Tags |