comparison servlet/src/digilib/io/DocuDirCache.java @ 181:afe7ff98bb71

Servlet version 1.18b1 - new transfer mode "rawfile" with mime-type application/octet-stream - finally proper logging with Log4J! - therefore a lot of debugging-prints changed - the Util class is now useless - ServletOps and FileOps are now purely static
author robcast
date Fri, 21 Nov 2003 00:17:31 +0100
parents 67ff8c7fecb9
children b3f9a7f646c5
comparison
equal deleted inserted replaced
180:bd87f802bea1 181:afe7ff98bb71
26 import java.util.HashMap; 26 import java.util.HashMap;
27 import java.util.Iterator; 27 import java.util.Iterator;
28 import java.util.LinkedList; 28 import java.util.LinkedList;
29 import java.util.List; 29 import java.util.List;
30 30
31 import org.apache.log4j.Logger;
32
31 /** 33 /**
32 * @author casties 34 * @author casties
33 */ 35 */
34 public class DocuDirCache { 36 public class DocuDirCache {
35 37
38 /** general logger for this class */
39 protected Logger logger = Logger.getLogger(this.getClass());
36 /** HashMap of directories */ 40 /** HashMap of directories */
37 protected HashMap map = null; 41 protected HashMap map = null;
38 /** names of base directories */ 42 /** names of base directories */
39 private String[] baseDirNames = null; 43 private String[] baseDirNames = null;
40 /** array of allowed file classes (image/text) */ 44 /** array of allowed file classes (image/text) */
86 * @param newdir 90 * @param newdir
87 */ 91 */
88 public void put(DocuDirectory newdir) { 92 public void put(DocuDirectory newdir) {
89 String s = newdir.getDirName(); 93 String s = newdir.getDirName();
90 if (map.containsKey(s)) { 94 if (map.containsKey(s)) {
91 System.out.println("Baah, duplicate key in DocuDirCache.put!"); 95 logger.warn("Baah, duplicate key in DocuDirCache.put!");
92 } else { 96 } else {
93 map.put(s, newdir); 97 map.put(s, newdir);
94 numFiles += newdir.size(); 98 numFiles += newdir.size();
95 } 99 }
96 } 100 }