[
https://issues.apache.org/jira/browse/SSHD-893?focusedWorklogId=196956&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-196956
]
ASF GitHub Bot logged work on SSHD-893:
---------------------------------------
Author: ASF GitHub Bot
Created on: 11/Feb/19 14:55
Start Date: 11/Feb/19 14:55
Worklog Time Spent: 10m
Work Description: thefourtheye commented on pull request #89: [SSHD-893]
Fix SCP download with pattern issue in rooted filesystem
URL: https://github.com/apache/mina-sshd/pull/89#discussion_r255539240
##########
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:
The comment above effectively says "returns an unmodifiable list". But if
somebody casts the returned list to an `ArrayList`, it would be modifiable,
right? Perhaps a
[`Collections.unmodifiableList`](https://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#unmodifiableList(java.util.List))
is in order?
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 196956)
> SCP download with pattern does not work download with virtual filesystem
> ------------------------------------------------------------------------
>
> Key: SSHD-893
> URL: https://issues.apache.org/jira/browse/SSHD-893
> Project: MINA SSHD
> Issue Type: Bug
> Affects Versions: 2.2.0
> Reporter: Subramaniajeeva
> Assignee: Goldstein Lyor
> Priority: Minor
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Right now, download with pattern doesn't work when the underlying
> filesystem is virtual filesystem. Also, current tests were masking the
> behaviour by providing working location as rooted filesystem path.
> Handled the same with PR: https://github.com/apache/mina-sshd/pull/88
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)