public static Map<File, File> mapPaths(File srcDir, File dstDir) {
        Validate.notNull(srcDir);
        Validate.notNull(dstDir);
        Validate.isTrue(srcDir.isDirectory());
        Validate.isTrue(dstDir.isDirectory());

        Map<File, File> ret = new HashMap<>();
        
        FileUtils.listFiles(srcDir, new String[]{"class"}, true).forEach((inputFile) -> {
            Path relativePath = srcDir.toPath().relativize(inputFile.toPath());
            Path outputFilePath = dstDir.toPath().resolve(relativePath);
            File outputFile = outputFilePath.toFile();

            ret.put(inputFile, outputFile);
        }
public static Map < File , File > mapPaths ( File srcDir , File dstDir ) { Validate . notNull ( srcDir ) ; Validate . notNull ( dstDir ) ; Validate . isTrue ( srcDir . isDirectory ( ) ) ; Validate . isTrue ( dstDir . isDirectory ( ) ) ; Map < File , File > ret = new HashMap < > ( ) ; FileUtils . listFiles ( srcDir , new String [ ] { "class" } , true ) . forEach ( ( inputFile ) -> { Path relativePath = srcDir . toPath ( ) . relativize ( inputFile . toPath ( ) ) ; Path outputFilePath = dstDir . toPath ( ) . resolve ( relativePath ) ; File outputFile = outputFilePath . toFile ( ) ; ret . put ( inputFile , outputFile ) ; }
Given a source and destination path, scans the source path for class files and translates them to the destination path. This
method recursively scans the path.
<p>
For example, imagine source path of {@code /src} and a destination path of {@code /dst}...
<pre>
/src/A.class -&gt; /dst/A.class
/src/a/B.class -&gt; /dst/B.class
/src/a/b/c/d/e/C.class -&gt; /dst/a/b/c/d/e/C.class
/src/a/b/c/d/e/D.class -&gt; /dst/a/b/c/d/e/D.class
</pre>
@param srcDir source directory
@param dstDir destination directory
@throws NullPointerException if any argument is {@code null}
@throws IllegalArgumentException if either of the paths passed in are not directories
@return source class to destination class mapping