Java.nio.Files, java.nio.Paths in java 6

I need to rewrite some java 7 code input code that should run on a Java 6 virtual machine.

The implementation uses convenient Java 7 features such as autocomplete, Pathsand Files.

To be more specific, I need to process type expressions /tmp/foo/*.barto return all .bar files (currently implemented with Files.newDirectoryStream(dir, glob)).

Does anyone know a convenient library for this?

+3
source share
3 answers

The Apache Ant API would be a good candidate for this, in particular, the FileSet class could do the job.

0
source

guava java6 I/O api.

0

The Apache Commons IO API is also a good choice. I used it for similar work (rewrite some code from java7 to java6 that used the Path object) and they work very well.

0
source

All Articles