Class FileNameEncoder


  • public class FileNameEncoder
    extends Object
    Same as URLEncoder except '*' and ' ' are also encoded since they are not acceptable as file names on windows. ' ' is acctually only not acceptable on windows if it's the only character in a file name but we encode it anyway to make things easier. Also, ' ' is not encoded to '+' as it would in URL encoding, and '+' is not encoded. Lastly, '=' is also not encoded since it doesn't need to be and is contained many times in a dn.
    • Method Detail

      • encode

        public static String encode​(String s)
        Translates a string into x-www-form-urlencoded format with some differences as described at the top of this class. This method uses UTF-8 as the encoding scheme to obtain the bytes for unsafe characters.
        Parameters:
        s - String to be translated.
        Returns:
        the translated String.