Package org.apache.commons.codec.net

Examples of org.apache.commons.codec.net.QuotedPrintableCodec.decode()


    String line;
    QuotedPrintableCodec codec = new QuotedPrintableCodec();
    while ((line = r.readLine()) != null){
      String split[] = line.split(":", 2);
      if (split[0].toUpperCase().contains("QUOTED-PRINTABLE")){
        codec.decode(split[1]);
        //It will throw an exception and fail the test if it cannot be decoded
      }
    }
  }
 
View Full Code Here


                                        while ((c = is.read()) != -1) {
                                                sb.append(c);
                                                System.out.write(c);
                                        }
                                        is.close();
                                        String decoded = qp.decode(sb.toString());
                                        logger.info("decode message is " + decoded);
                                        if (decoded.contains(contains)) {
                                                //found it
                                                messages[i].setFlag(Flags.Flag.DELETED, true);
                                                found++;
View Full Code Here

     */
    private String getDecodedMessage() {
        String body = removeSoftLineBreaks(email.getBody());
        QuotedPrintableCodec codec = new QuotedPrintableCodec();
        try {
            return codec.decode(body);
        } catch (DecoderException e) {
            e.printStackTrace();
        }

        return null;
View Full Code Here

  // Decode RFC 1521 MIME (Multipurpose Internet Mail Extensions)
  // Part One. Rules #3, #4, and #5 of the quoted-printable spec are not implemented yet
  private static String decodeRfc1521(final String decodeText) {
    final QuotedPrintableCodec codec = new QuotedPrintableCodec();
    try {
      return codec.decode(decodeText);
    } catch (final DecoderException e) {
      return "Error: RFC 1521 MIME value cannot be decoded...";
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.