i2p.susi.util

## Class FilenameUtil

- java.lang.Object
- - i2p.susi.util.FilenameUtil

-     public class FilenameUtil
      extends Object

  File name encoding utilities for cross-platform compatibility.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FilenameUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `decodeFilenameRFC5987(String name)` Modified from QuotedPrintable.decode()
    `static String` | `encodeFilenameRFC5987(String name)` Encode the UTF-8 suitable for inclusion in a header as a RFC 5987/6266 filename* value, and for use as a cross-platform filename.
    `static String` | `sanitizeFilename(String name)` Convert the UTF-8 to ASCII suitable for inclusion in a header and for use as a cross-platform filename.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FilenameUtil

          public FilenameUtil()

  - ### Method Detail

    - #### decodeFilenameRFC5987

          public static String decodeFilenameRFC5987(String name)

      Modified from QuotedPrintable.decode()
      Returns:
        name on error

    - #### encodeFilenameRFC5987

          public static String encodeFilenameRFC5987(String name)

      Encode the UTF-8 suitable for inclusion in a header as a RFC 5987/6266 filename* value, and for use as a cross-platform filename. Replace chars likely to be illegal in filenames with _ Ref: RFC 6266, RFC 5987, i2psnark Storage.ILLEGAL This does NOT do multiline, e.g. filename*0* (RFC 2231) ref: https://blog.nodemailer.com/2017/01/27/the-mess-that-is-attachment-filenames/ ref: RFC 2231

    - #### sanitizeFilename

          public static String sanitizeFilename(String name)

      Convert the UTF-8 to ASCII suitable for inclusion in a header and for use as a cross-platform filename. Replace chars likely to be illegal in filenames, and non-ASCII chars, with _ Ref: RFC 6266, RFC 5987, i2psnark Storage.ILLEGAL