Index: MRUMemoryStore.java
===================================================================
RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/components/store/MRUMemoryStore.java,v
retrieving revision 1.23
diff -u -r1.23 MRUMemoryStore.java
--- MRUMemoryStore.java	2001/11/21 10:45:40	1.23
+++ MRUMemoryStore.java	2001/11/21 12:54:59
@@ -25,6 +25,8 @@
 import org.apache.cocoon.Constants;
 import org.apache.cocoon.util.ClassUtils;
 import org.apache.cocoon.util.IOUtils;
+import org.apache.regexp.RE;
+import org.apache.regexp.RESyntaxException;
 
 import java.io.File;
 import java.io.IOException;
@@ -195,7 +197,6 @@
      */
     public Object get(Object key) {
         this.getLogger().debug("Getting object from memory. Key: " + key);
-
         Object tmpobject = this.cache.get(key);
         if ( tmpobject != null ) {
             /** put the accessed key on top of the linked list */
@@ -267,7 +268,7 @@
      */
     public Enumeration keys() {
         /* Not yet implemented */
-        return null;
+        return new StoreEnumeration(this.cache.keys(), this.fsstore.keys(),this.cachedirstr);
     }
 
     /**
@@ -326,4 +327,48 @@
           .append(URLEncoder.encode(key.toString()))
           .toString();
     }
+
+    final class StoreEnumeration implements Enumeration {
+      private int index;
+      private Enumeration mCache;
+      private Enumeration mFs;
+      private String mCachedir;
+
+      StoreEnumeration(Enumeration cache, Enumeration fs, String cachedir) {
+        this.mCache = cache;
+        this.mFs = fs;
+        this.mCachedir = cachedir;
+        this.index = 0;
+      }
+
+      public boolean hasMoreElements() {
+        return (mCache.hasMoreElements() || mFs.hasMoreElements());
+      }
+
+      public Object nextElement() {
+        if(this.hasMoreElements()) {
+          if (mCache.hasMoreElements()) {
+            return mCache.nextElement();
+          } else if(mFs.hasMoreElements()) {
+            String str = (String)mFs.nextElement();
+            if(!dirFilter(str)) {
+              this.nextElement();
+            }
+            return mFs.nextElement();
+          }
+        }
+        return null;
+      }
+
+      private boolean dirFilter(String file) {
+        RE re = null;
+
+        try {
+          re = new RE("^" + this.mCachedir);
+        } catch(RESyntaxException ree) {
+          ree.printStackTrace();
+        }
+        return re.match(file);
+      }
+   }
 }

