private static void surveyFiles(final File topDir, final List<String[]> pathList, final int[] maxLen, final boolean csv, final PrintStream ps) {
        final SurveyTiffFile surveyor = new SurveyTiffFile();
        int n = maxLen.length - 1;
        for (final int element : maxLen) {
            n += element;
        }
        if (n < 10) {
            n = 10;
        }

        final String header = surveyor.formatHeader(n, csv);
        ps.println(header);

        final List<String> badFiles = new ArrayList<>();
        for (final String[] path : pathList) {
            final StringBuilder sBuilder = new StringBuilder();
            File file = topDir;
            for (final String s : path) {
                file = new File(file, s);
            }
            for (int i = 0; i < path.length; i++) {
                if (i > 0) {
                    sBuilder.append('/');
                }
                sBuilder.append(path[i]);
            }
            if (!csv) {
                for (int i = sBuilder.length(); i < n; i++) {
                    sBuilder.append(' ');
                }
            }

            final String result;
            try {
                result = surveyor.surveyFile(file, csv);
            } catch (final IOException ex) {
                sBuilder.append(ex.getMessage());
                badFiles.add(sBuilder.toString());
                continue; // result = ex.getMessage();
            }
            sBuilder.append(result);
            ps.println(sBuilder.toString());
        }
        if (!csv && !badFiles.isEmpty()) {
            ps.println();
            ps.println("Bad Files:");
            for (final String s : badFiles) {
                ps.println(s);
            }
        }

        if (!csv) {
            ps.println();
            surveyor.printLegend(ps);
        }
    }
@param args the command line arguments
src/test/java/org/apache/commons/imaging/examples/tiff/SurveyTiffFolder.java