[jboss-cvs] JBossAS SVN: r101303 - in projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss: virtual and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Feb 22 22:27:12 EST 2010


Author: johnbailey
Date: 2010-02-22 22:27:11 -0500 (Mon, 22 Feb 2010)
New Revision: 101303

Added:
   projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss/ejb3/vfs/impl/vfs3/VirtualFileFilterAdapter.java
Modified:
   projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss/ejb3/vfs/impl/vfs3/VirtualFileWrapper.java
   projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss/virtual/VirtualFile.java
   projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss/virtual/VirtualFileFilter.java
Log:
[EJBTHREE-2007] - Updated VFS3 abstraction implementation to function with VFS2 interfaces

Added: projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss/ejb3/vfs/impl/vfs3/VirtualFileFilterAdapter.java
===================================================================
--- projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss/ejb3/vfs/impl/vfs3/VirtualFileFilterAdapter.java	                        (rev 0)
+++ projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss/ejb3/vfs/impl/vfs3/VirtualFileFilterAdapter.java	2010-02-23 03:27:11 UTC (rev 101303)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.vfs.impl.vfs3;
+
+import org.jboss.vfs.VirtualFile;
+import org.jboss.vfs.VirtualFileFilter;
+
+/**
+ * A VirtualFileFilter that provides an adapter between the EJB3 VFS abstraction 
+ * layer and VFS3. 
+ */
+public class VirtualFileFilterAdapter implements VirtualFileFilter
+{
+   /* EJB3 VFS Abstraction Filter */
+   private final org.jboss.virtual.VirtualFileFilter delegate;
+
+   /**
+    * Constructs a new instance with a VFS abstract VirtualFileFilter
+    * 
+    * @param delegate 
+    */
+   public VirtualFileFilterAdapter(org.jboss.virtual.VirtualFileFilter delegate)
+   {
+      this.delegate = delegate;
+   }
+
+   @Override
+   public boolean accepts(VirtualFile file)
+   {
+      return delegate.accepts(new VirtualFileWrapper(file));
+   }
+
+}

Modified: projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss/ejb3/vfs/impl/vfs3/VirtualFileWrapper.java
===================================================================
--- projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss/ejb3/vfs/impl/vfs3/VirtualFileWrapper.java	2010-02-23 00:59:16 UTC (rev 101302)
+++ projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss/ejb3/vfs/impl/vfs3/VirtualFileWrapper.java	2010-02-23 03:27:11 UTC (rev 101303)
@@ -27,12 +27,20 @@
 import java.io.InputStream;
 
 /**
+ * EJB VFS adapter VirtualFile implementation
+ * 
  * @author <a href="cdewolf at redhat.com">Carlo de Wolf</a>
  */
 public class VirtualFileWrapper implements VirtualFile
 {
+   /* VFS3 VirtualFile being wrapped */
    private org.jboss.vfs.VirtualFile delegate;
 
+   /**
+    * Constructs a new adapter VirutalFile with a concrete VFS3 VirtualFile instance
+    * 
+    * @param delegate
+    */
    public VirtualFileWrapper(org.jboss.vfs.VirtualFile delegate)
    {
       this.delegate = delegate;
@@ -61,4 +69,10 @@
    {
       return delegate.openStream();
    }
+
+   @Override
+   public org.jboss.vfs.VirtualFile getWrapped()
+   {
+      return delegate;
+   }
 }

Modified: projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss/virtual/VirtualFile.java
===================================================================
--- projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss/virtual/VirtualFile.java	2010-02-23 00:59:16 UTC (rev 101302)
+++ projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss/virtual/VirtualFile.java	2010-02-23 03:27:11 UTC (rev 101303)
@@ -24,10 +24,22 @@
 import java.io.IOException;
 
 /**
+ * Temporary VirtualFile interface which matches the legacy VFS3 interface. 
+ * 
  * @author <a href="cdewolf at redhat.com">Carlo de Wolf</a>
  */
 @Deprecated
 public interface VirtualFile extends org.jboss.ejb3.vfs.spi.VirtualFile
 {
-   VirtualFile getParent() throws IOException;   
+   /**
+    * Get the parent VirtualFile
+    */
+   VirtualFile getParent() throws IOException;
+   
+   /**
+    * Returns the wrapped VirtualFile instance 
+    *  
+    * @return wrapped VirtualFile
+    */
+   org.jboss.vfs.VirtualFile getWrapped();
 }

Modified: projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss/virtual/VirtualFileFilter.java
===================================================================
--- projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss/virtual/VirtualFileFilter.java	2010-02-23 00:59:16 UTC (rev 101302)
+++ projects/ejb3/components/vfs/trunk/impl-vfs3/src/main/java/org/jboss/virtual/VirtualFileFilter.java	2010-02-23 03:27:11 UTC (rev 101303)
@@ -21,10 +21,23 @@
  */
 package org.jboss.virtual;
 
+import org.jboss.virtual.VirtualFile;
+
 /**
+ * VirtualFileFilter matching the VFS2 interface.  Should be removed
+ * when the full VFS abstraction layer is in place. 
+ * 
  * @author <a href="cdewolf at redhat.com">Carlo de Wolf</a>
  */
 @Deprecated
 public interface VirtualFileFilter
 {
+   /**
+    * Match the virtual file
+    *
+    * @param file the virtual file
+    *
+    * @return true when it matches
+    */
+   boolean accepts(VirtualFile file);
 }




More information about the jboss-cvs-commits mailing list