public static List addFilesToCompress()

in src/main/java/com/amazonaws/codepipeline/jenkinsplugin/CompressionTools.java [173:200]


    public static List<File> addFilesToCompress(final Path pathToCompress, final BuildListener listener) throws IOException {
        final List<File> files = new ArrayList<>();

        if (pathToCompress != null) {
            Files.walkFileTree(
                    pathToCompress,
                    EnumSet.of(FileVisitOption.FOLLOW_LINKS),
                    Integer.MAX_VALUE,
                    new SimpleFileVisitor<Path>() {
                @Override
                public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException {
                    files.add(file.toFile());
                    return FileVisitResult.CONTINUE;
                }
                @Override
                public FileVisitResult visitFileFailed(final Path file, final IOException e) throws IOException {
                    if (e != null) {
                        LoggingHelper.log(listener, "Failed to visit file '%s'. Error: %s.", file.toString(), e.getMessage());
                        LoggingHelper.log(listener, e);
                        throw e;
                    }
                    return FileVisitResult.CONTINUE;
                }
            });
        }

        return files;
    }