You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2011/10/31 14:03:26 UTC

svn commit: r1195438 - in /commons/proper/vfs/trunk: core/src/main/java/org/apache/commons/vfs2/FileDepthSelector.java core/src/main/java/org/apache/commons/vfs2/Selectors.java src/changes/changes.xml

Author: ggregory
Date: Mon Oct 31 13:03:26 2011
New Revision: 1195438

URL: http://svn.apache.org/viewvc?rev=1195438&view=rev
Log:
[VFS-372] Add constructors FileDepthSelector() and FileDepthSelector(int)

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileDepthSelector.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/Selectors.java
    commons/proper/vfs/trunk/src/changes/changes.xml

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileDepthSelector.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileDepthSelector.java?rev=1195438&r1=1195437&r2=1195438&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileDepthSelector.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileDepthSelector.java Mon Oct 31 13:03:26 2011
@@ -18,11 +18,10 @@ package org.apache.commons.vfs2;
 
 /**
  * A {@link FileSelector} that selects all files in a particular depth range.
- *
+ * 
  * @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
  */
-public class FileDepthSelector
-    implements FileSelector
+public class FileDepthSelector implements FileSelector
 {
     /**
      * The minimum depth
@@ -34,6 +33,14 @@ public class FileDepthSelector
      */
     private final int maxDepth;
 
+    /**
+     * Creates a selector with the given minimum and maximum depths.
+     * 
+     * @param minDepth
+     *            minimum depth
+     * @param maxDepth
+     *            maximum depth
+     */
     public FileDepthSelector(int minDepth, int maxDepth)
     {
         this.minDepth = minDepth;
@@ -41,8 +48,29 @@ public class FileDepthSelector
     }
 
     /**
+     * Creates a selector with the same minimum and maximum depths.
+     * 
+     * @param minMaxDepth
+     *            minimum and maximum depth
+     */
+    public FileDepthSelector(int minMaxDepth)
+    {
+        this(minMaxDepth, minMaxDepth);
+    }
+
+    /**
+     * Creates a selector with the same minimum and maximum depths of 0.
+     */
+    public FileDepthSelector()
+    {
+        this(0, 0);
+    }
+
+    /**
      * Determines if a file or folder should be selected.
-     * @param fileInfo The file selection information
+     * 
+     * @param fileInfo
+     *            The file selection information
      * @return true if the file or folder should be included, false otherwise.
      */
     public boolean includeFile(final FileSelectInfo fileInfo)
@@ -53,7 +81,9 @@ public class FileDepthSelector
 
     /**
      * Determines whether a folder should be traversed.
-     * @param fileInfo The file selection information
+     * 
+     * @param fileInfo
+     *            The file selection information
      * @return true if the file or folder should be traversed, false otherwise.
      */
     public boolean traverseDescendents(final FileSelectInfo fileInfo)

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/Selectors.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/Selectors.java?rev=1195438&r1=1195437&r2=1195438&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/Selectors.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/Selectors.java Mon Oct 31 13:03:26 2011
@@ -26,7 +26,7 @@ public final class Selectors
     /**
      * A {@link FileSelector} that selects only the base file/folder.
      */
-    public static final FileSelector SELECT_SELF = new FileDepthSelector(0, 0);
+    public static final FileSelector SELECT_SELF = new FileDepthSelector();
 
     /**
      * A {@link FileSelector} that selects the base file/folder and its
@@ -38,7 +38,7 @@ public final class Selectors
      * A {@link FileSelector} that selects only the direct children
      * of the base folder.
      */
-    public static final FileSelector SELECT_CHILDREN = new FileDepthSelector(1, 1);
+    public static final FileSelector SELECT_CHILDREN = new FileDepthSelector(1);
 
     /**
      * A {@link FileSelector} that selects all the descendents of the

Modified: commons/proper/vfs/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/src/changes/changes.xml?rev=1195438&r1=1195437&r2=1195438&view=diff
==============================================================================
--- commons/proper/vfs/trunk/src/changes/changes.xml (original)
+++ commons/proper/vfs/trunk/src/changes/changes.xml Mon Oct 31 13:03:26 2011
@@ -23,6 +23,9 @@
 
   <body>
     <release version="2.1" date="TBD" description="">
+      <action issue="VFS-372" dev="ggregory" type="update">
+        Add constructors FileDepthSelector() and FileDepthSelector(int).
+      </action>
       <action issue="VFS-341" dev="rgoers" type="update" due-to="Rajika Kumarasiri">
         Enable logging of JSch using the Commons Logging Log object in SftpClientFactory.
       </action>