You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by im...@apache.org on 2005/05/10 09:58:39 UTC

svn commit: r169436 - in /jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs: FileObject.java provider/AbstractFileObject.java

Author: imario
Date: Tue May 10 00:58:39 2005
New Revision: 169436

URL: http://svn.apache.org/viewcvs?rev=169436&view=rev
Log:
PR: 34817
Reported By: Philippe Poulard <philippe.poulard -at- inria.fr>

Moved private method from AbstractFileObject to public interface FileObject.

findFiles(FileSelector, boolean depthwise, List)
allows to findFiles and additively put them into the List

Modified:
    jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/FileObject.java
    jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java

Modified: jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/FileObject.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/FileObject.java?rev=169436&r1=169435&r2=169436&view=diff
==============================================================================
--- jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/FileObject.java (original)
+++ jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/FileObject.java Tue May 10 00:58:39 2005
@@ -1,12 +1,12 @@
 /*
  * Copyright 2002, 2003,2004 The Apache Software Foundation.
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,6 +16,7 @@
 package org.apache.commons.vfs;
 
 import java.net.URL;
+import java.util.List;
 
 /**
  * Represents a file, and is used to access the content and
@@ -187,6 +188,18 @@
      *         (that is, a child appears in the list before its parent).
      */
     FileObject[] findFiles(FileSelector selector) throws FileSystemException;
+
+    /**
+         * Finds the set of matching descendents of this file.
+         *
+         * @param selector  the selector used to determine if the file should be selected
+         * @param depthwise controls the ordering in the list. e.g. deepest first
+         * @param selected  container for selected files. list needs not to be empty.
+         * @throws FileSystemException
+         */
+    void findFiles(FileSelector selector,
+                   boolean depthwise,
+                   List selected) throws FileSystemException;
 
     /**
      * Deletes this file.  Does nothing if this file does not exist of if it is a

Modified: jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java?rev=169436&r1=169435&r2=169436&view=diff
==============================================================================
--- jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java (original)
+++ jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java Tue May 10 00:58:39 2005
@@ -1,12 +1,12 @@
 /*
  * Copyright 2002, 2003,2004 The Apache Software Foundation.
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -841,7 +841,7 @@
 
         // Locate the files to copy across
         final ArrayList files = new ArrayList();
-        ((AbstractFileObject) file).findFiles(selector, false, files);
+        file.findFiles(selector, false, files);
 
         // Copy everything across
         final int count = files.size();
@@ -1340,7 +1340,7 @@
      * Traverses the descendents of this file, and builds a list of selected
      * files.
      */
-    private void findFiles(final FileSelector selector,
+    public void findFiles(final FileSelector selector,
                            final boolean depthwise,
                            final List selected) throws FileSystemException
     {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org