commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jorge Spinsanti (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (IO-489) EmptyFileFilter doesn't work on directories
Date Wed, 02 Dec 2015 18:22:11 GMT

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

Jorge Spinsanti updated IO-489:
-------------------------------
    Description: 
My directory tree:
{code}
~/ioutils> ls -lhR
.:
total 20K
drwxrwxr-x 2 jorge jorge 4.0K Dec  2 14:54 empty/
drwxrwxr-x 2 jorge jorge 4.0K Dec  2 14:54 not-empty/
-rw-rw-r-- 1 jorge jorge    5 Dec  2 15:02 text.txt

./empty:
total 0

./not-empty:
total 12K
-rw-rw-r-- 1 jorge jorge 5 Dec  2 14:54 text.txt
{code}
When I execute:
{code}
String baseDir = "/home/jorge/ioutils";
FileUtils.listFilesAndDirs(new File(baseDir), 
				FileFilterUtils.and(
					DirectoryFileFilter.DIRECTORY,
					EmptyFileFilter.EMPTY
				), 
				TrueFileFilter.TRUE);
{code}
I obtain:
{code}
[/home/jorge/ioutils, /home/jorge/ioutils/not-empty, /home/jorge/ioutils/empty]
{code}
Issue:  {{/home/jorge/ioutils/not-empty}} directory is included in the result.


  was:
My directory tree:
{code}
~/ioutils> ls -lhR
.:
total 20K
drwxrwxr-x 2 jorge jorge 4.0K Dec  2 14:54 empty/
drwxrwxr-x 2 jorge jorge 4.0K Dec  2 14:54 not-empty/
-rw-rw-r-- 1 jorge jorge    5 Dec  2 15:02 text.txt

./empty:
total 0

./not-empty:
total 12K
-rw-rw-r-- 1 jorge jorge 5 Dec  2 14:54 text.txt
{code}
When I execute:
{code}
String baseDir = "/home/jorge/ioutils";
FileUtils.listFilesAndDirs(new File(baseDir), 
				FileFilterUtils.and(
					DirectoryFileFilter.DIRECTORY,
					EmptyFileFilter.EMPTY
				), 
				TrueFileFilter.TRUE);
{code}
I obtain:
{code}
[/home/jorge/ioutils, /home/jorge/ioutils/not-empty, /home/jorge/ioutils/empty]
{code}
Issue: not-empty is included.



> EmptyFileFilter doesn't work on directories
> -------------------------------------------
>
>                 Key: IO-489
>                 URL: https://issues.apache.org/jira/browse/IO-489
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Filters
>    Affects Versions: 2.4
>         Environment: Distributor ID:	Ubuntu
> Description:	Ubuntu 12.04.5 LTS
> Release:	12.04
> Codename:	precise
>            Reporter: Jorge Spinsanti
>
> My directory tree:
> {code}
> ~/ioutils> ls -lhR
> .:
> total 20K
> drwxrwxr-x 2 jorge jorge 4.0K Dec  2 14:54 empty/
> drwxrwxr-x 2 jorge jorge 4.0K Dec  2 14:54 not-empty/
> -rw-rw-r-- 1 jorge jorge    5 Dec  2 15:02 text.txt
> ./empty:
> total 0
> ./not-empty:
> total 12K
> -rw-rw-r-- 1 jorge jorge 5 Dec  2 14:54 text.txt
> {code}
> When I execute:
> {code}
> String baseDir = "/home/jorge/ioutils";
> FileUtils.listFilesAndDirs(new File(baseDir), 
> 				FileFilterUtils.and(
> 					DirectoryFileFilter.DIRECTORY,
> 					EmptyFileFilter.EMPTY
> 				), 
> 				TrueFileFilter.TRUE);
> {code}
> I obtain:
> {code}
> [/home/jorge/ioutils, /home/jorge/ioutils/not-empty, /home/jorge/ioutils/empty]
> {code}
> Issue:  {{/home/jorge/ioutils/not-empty}} directory is included in the result.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message