thefourtheye commented on a change in pull request #89: [SSHD-893] Fix SCP 
download with pattern issue in rooted filesystem
URL: https://github.com/apache/mina-sshd/pull/89#discussion_r255806398
 
 

 ##########
 File path: 
sshd-common/src/main/java/org/apache/sshd/common/util/io/DirectoryScanner.java
 ##########
 @@ -188,21 +187,36 @@ public File getBasedir() {
      *
      * <p>When a pattern ends with a '/' or '\', "**" is appended.</p>
      *
-     * @param includes A list of include patterns.
-     *                 May be {@code null}, indicating that all files
-     *                 should be included. If a non-{@code null}
-     *                 list is given, all elements must be
-     *                 non-{@code null}.
+     * @param includes A list of include patterns. May be {@code null}, 
indicating
+     * that all files should be included. If a non-{@code null} list is given, 
all
+     * elements must be non-{@code null}.
      */
-    public void setIncludes(String[] includes) {
-        if (includes == null) {
-            this.includes = null;
-        } else {
-            this.includes = new String[includes.length];
-            for (int i = 0; i < includes.length; i++) {
-                this.includes[i] = normalizePattern(includes[i]);
-            }
-        }
+    public void setIncludes(String... includes) {
+        setIncludes(GenericUtils.isEmpty(includes) ? Collections.emptyList() : 
Arrays.asList(includes));
+    }
+
+    /**
+     * @return Un-modifiable list of the inclusion patterns
+     */
+    public List<String> getIncludes() {
+        return includePatterns;
 
 Review comment:
   Gotcha. Thanks.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to