if (recursive) { // follow links when copying files EnumSet opts = EnumSet.of(FileVisitOption.FOLLOW_LINKS); TreeCopier tc = new TreeCopier(source[i], dest, prompt, preserve); Files.walkFileTree(source[i], opts, Integer.MAX_VALUE, tc); } else { // not recursive so source must not be a directory if (Files.isDirectory(source[i])) { System.err.format("%s: is a directory%n", source[i]); continue; } copyFile(source[i], dest, prompt