Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SourceStream factory: filter does not work well with recursive #23

Open
rbossy opened this issue Aug 10, 2020 · 0 comments
Open

SourceStream factory: filter does not work well with recursive #23

rbossy opened this issue Aug 10, 2020 · 0 comments

Comments

@rbossy
Copy link
Member

rbossy commented Aug 10, 2020

import fr.inra.maiage.bibliome.util.streams.PatternFileFilter;
import fr.inra.maiage.bibliome.util.streams.DirectorySourceStream;
import java.util.regex.Pattern;
import java.io.FileFilter;
import fr.inra.maiage.bibliome.util.files.InputDirectory;

InputDirectory dir = new InputDirectory("mydirectory");
FileFilter filter = new PatternFileFilter(Pattern.compile("\\.xml$"), false, false);
new DirectorySourceStream("UTF-8", CompressionFilter.NONE, new InputDirectory("foo"), true, FileFilter filter)

This will not very well because sub-directories that don't match the filter will not be walked through.

Solution: filter should not apply to directories and sub-directories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant