[ 
https://issues.apache.org/jira/browse/IO-875?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary D. Gregory resolved IO-875.
--------------------------------
    Fix Version/s: 2.20.0
       Resolution: Fixed

[~pbaumard] 

TY for the PR. This is now in git master and snapshot builds on 
https://repository.apache.org/content/repositories/snapshots/. Please verify 
and close.

 

> CopyDirectoryVisitor ignores fileFilter
> ---------------------------------------
>
>                 Key: IO-875
>                 URL: https://issues.apache.org/jira/browse/IO-875
>             Project: Commons IO
>          Issue Type: Bug
>    Affects Versions: 2.9.0
>            Reporter: Pierre Baumard
>            Priority: Major
>             Fix For: 2.20.0
>
>
> In CopyDirectoryVisitorTest, assertion is true when adding this test :
> {code:java}
>     @ParameterizedTest
>     @MethodSource("pathCounters")
>     public void testCopyDirectoryFilters(final PathCounters pathCounters) 
> throws IOException {
>         final Path sourceDir = 
> Paths.get("src/test/resources/org/apache/commons/io/dirs-2-file-size-4");
>         final CopyDirectoryVisitor visitFileTree = 
> PathUtils.visitFileTree(new CopyDirectoryVisitor(pathCounters, new 
> NameFileFilter("file-size-1.bin"),
>             new NameFileFilter("dirs-2-file-size-4", "dirs-a-file-size-1"), 
> sourceDir, targetDir, EXPECTED_COPY_OPTIONS),
>             sourceDir);
>         
> assertFalse(Files.exists(targetDir.resolve("dirs-a-file-size-1/file-size-2.bin")));
>     }{code}
> Any _fileFilter_ will be ignored, only _dirFilter_ actually filters copied 
> files.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to