String formatHeader(final int maxPathLen, final boolean csv) {
        // After some false starts, it turned out that the easiest
        // way to do this is just to create a regular header and then
        // search-and-replace spaces with comma as appropriate.
        int n = maxPathLen;
        if (n < 10) {
            n = 10;
        }
        final int k0 = (n - 4) / 2;
        final int k1 = n - 4 - k0;

        final String header = String.format("%" + k0 + "sPath%" + k1 + "s%s", "", "",
                "    Size     Layout  Blk_sz     P_conf  Compress  " + "Predict  Data_Fmt   B/P B/S      Photo     ICC_Pro");
        if (csv) {
            return reformatHeaderForCsv(header);
        }
        return header;
    }
Formats a header allowing space for the maximum length of the file paths in the list. If the comma-separated-value option is set, spaces will be
suppressed and commas introduced as separators.

@param maxPathLen the maximum length of a file path (used if csv option is not set)
@param csv        true if formatting is configured for comma-separated-value files.
@return a valid string.
src/test/java/org/apache/commons/imaging/examples/tiff/SurveyTiffFile.java