code: static String parseAttachmentFilename(Header header) throws UnsupportedEncodingException {
      if (header == null) {
        return null;
      }
      String value = header.getValue();
      String filenameWild = "filename*";
      int filenameWildIndex = value.indexOf(filenameWild);
      if (filenameWildIndex != -1) {
        int lastIndex = value.indexOf(';', filenameWildIndex);
        String substring;
        if (lastIndex == -1) {
          substring = value.substring(filenameWildIndex + filenameWild.length() + 1);
        } else {
          substring = value.substring(filenameWildIndex + filenameWild.length() + 1, lastIndex);
        }
        String[] ary = substring.split("''");
        return URLDecoder.decode(ary[1], ary[0]);
      }
      String filename = "filename";
      int filenameIndex = value.indexOf(filename);
      if (filenameIndex != -1) {
        int lastIndex = value.indexOf(';', filenameIndex);
        String substring;
        // 处理filename=文件名，不包含双引号的情况
        int offset = 2;
        if (value.substring(filenameIndex + filename.length() + 1).charAt(0) != '\"') {
          offset = 1;
        }
        if (lastIndex == -1) {
          substring = value.substring(filenameIndex + filename.length() + offset);
        } else {
          substring = value
              .substring(filenameIndex + filename.length() + offset, offset == 2 ? lastIndex - 1 : lastIndex);
        }
        return URLDecoder.decode(substring, "UTF-8");
      }
      throw new IllegalStateException("不合法的附件头信息" + header.getName() + ": " + header.getValue());
    }
docs: 处理附件的文件名。支持RFC 6266标准
  <pre>
  Content-Disposition: attachment;filename="encoded_text";filename*=utf-8''encoded_text
  </pre>