1 package org
.de
.metux
.datasource
;
4 import java
.util
.Hashtable
;
5 import java
.util
.Properties
;
7 import org
.de
.metux
.util
.TextDB
;
9 public class Cached_TextDB_Loader
implements ITextDB_Loader
11 public boolean enabled
= true;
13 Hashtable
<String
,Properties
> cache
= null;
15 public void clearCache()
20 public void setCaching(boolean e
)
25 private Properties
__load(String fn
)
27 Properties pr
= new Properties();
28 if (TextDB
.LoadIntoHashtable(fn
,pr
))
34 public Properties
load(String filename
)
40 return __load(filename
);
45 cache
= new Hashtable
<String
,Properties
>();
46 else if ((pr
= cache
.get(filename
)) != null)
49 if ((pr
= __load(filename
)) != null)
50 cache
.put(filename
,pr
);
55 public Properties
load(File filename
)
57 return load(filename
.toString());