[jcifs] Hidden Files from listFiles()?

Michael B Allen mba2000 at ioplex.com
Tue Nov 4 15:08:27 EST 2003


I am implementing SmbFileFilter (and SmbFilenameFilter) and will provide a
DosFileFilter( String wildcard, int attributes ). If we can filter by
attributes should the non-filtered listFiles operations return hidden
files? If so that will break backward compatibility. If users want hidden
files, instead of doing:

    dir.listFiles( "*" );

they will need to use:

    DosFileFilter dff = new DosFileFilter( "*",
        ATTR_DIRECTORY | ATTR_HIDDEN | ATTR_SYSTEM );
    dir.listFiles( dff );

to get them. Or if we include hidden files by default they could do the
following to exclude them:

    DosFileFilter dff = new DosFileFilter( "*",
        ATTR_DIRECTORY | ATTR_SYSTEM );
    dir.listFiles( dff );

I think I'm leaning toward case 2 just because jCIFS is more likely to be
used to utilitarian purposes as opposed to casually perusing through files
with the capacity to delete something by accident.

Chris,

Have you ever noticed ATTR_READONLY and ATTR_ARCHIVE are basically ignored
by TRANS2_FIND_FIRST2/NEXT2?

Mike

--
A program should be written to  model the concepts of the task it
performs rather than the physical world or a process because this
maximizes the  potential for it  to be applied  to tasks that are
conceptually similar and, more  important, to tasks that have not
yet been conceived.



More information about the jcifs mailing list