Examples of MessagingException


Examples of javax.mail.MessagingException

      oStmt.close();
      oStmt = null;

      if (!bFound) {
        if (DebugFile.trace) DebugFile.decIdent();
        throw new MessagingException("Part not found");
      }
      if (!sDisposition.equals("reference") && !sDisposition.equals("pointer")) {
        if (DebugFile.trace) DebugFile.decIdent();
        throw new MessagingException("Only parts with reference or pointer disposition can be removed from a message");
      }
      else {
        if (sDisposition.equals("reference")) {
          try {
          File oRef = new File(sFileName);
          if (oRef.exists())
            oRef.delete();
          }
          catch (SecurityException se) {
            if (DebugFile.trace) DebugFile.writeln("SecurityException " + sFileName + " " + se.getMessage());
            if (DebugFile.trace) DebugFile.decIdent();
            throw new MessagingException("SecurityException " + sFileName + " " + se.getMessage(), se);
          }
        } // fi (reference)

        oStmt = oFldr.getConnection().createStatement();
        if (DebugFile.trace) DebugFile.writeln("Statement.executeUpdate(DELETE FROM " + DB.k_mime_parts + " WHERE " + DB.gu_mimemsg + "='" + oMsg.getMessageGuid() + "' AND " + DB.id_part + "=" + String.valueOf(iPart)+")");
        oStmt.executeUpdate("DELETE FROM " + DB.k_mime_parts + " WHERE " + DB.gu_mimemsg + "='" + oMsg.getMessageGuid() + "' AND " + DB.id_part + "=" + String.valueOf(iPart));
        oStmt.close();
        oStmt = null;
        oFldr.getConnection().commit();
      }
    }
    catch (SQLException sqle) {
      if (oRSet!=null) { try { oRSet.close(); } catch (Exception ignore) {} }
      if (oStmt!=null) { try { oStmt.close(); } catch (Exception ignore) {} }
      try { oFldr.getConnection().rollback(); } catch (Exception ignore) {}
      if (DebugFile.trace) DebugFile.decIdent();
      throw new MessagingException (sqle.getMessage(), sqle);
    }

    if (DebugFile.trace) {
      DebugFile.decIdent();
      DebugFile.writeln("End DBMimeMultipart.removeBodyPart()");
View Full Code Here

Examples of javax.mail.MessagingException

      if (oFolder.getClass().getName().equals("com.knowgate.hipermail.DBFolder")) {

    try {
          if (((DBFolder)oFolder).getConnection()==null) {
            if (DebugFile.trace) DebugFile.decIdent();
            throw new MessagingException("DBMimeMessage.getAllRecipients() not connected to the database");
          }
    } catch (SQLException sqle) {
          if (DebugFile.trace) DebugFile.decIdent();
          throw new MessagingException(sqle.getMessage(), sqle);
        }

        oAddrs = new DBSubset(DB.k_inet_addrs,
                              DB.gu_mimemsg + "," + DB.id_message + "," +
                              DB.tx_email + "," + DB.tx_personal + "," +
                              DB.tp_recipient + "," + DB.gu_user + "," +
                              DB.gu_contact + "," + DB.gu_company,
                              DB.gu_mimemsg + "=?", 10);
        try {
          iAddrs = oAddrs.load(((DBFolder)oFolder).getConnection(), new Object[]{sGuid});
        } catch (SQLException sqle) {
          if (DebugFile.trace) DebugFile.decIdent();
          throw new MessagingException(sqle.getMessage(), sqle);
        }

        if (iAddrs>0) {
          aAddrs = new DBInetAddr[iAddrs];
          for (int a = 0; a < iAddrs; a++) {
View Full Code Here

Examples of javax.mail.MessagingException

          sRetVal = super.getContentType();
        else
          sRetVal = (String) oHeaders.get("Content-Type");
      }
      catch (SQLException sqle) {
        throw new MessagingException (sqle.getMessage(), sqle);
      }
    }

    if (DebugFile.trace) {
      DebugFile.decIdent();
View Full Code Here

Examples of javax.mail.MessagingException

          dtRetVal = super.getSentDate();
        else
          dtRetVal = (java.util.Date) oHeaders.get("Date");
      }
      catch (SQLException sqle) {
        throw new MessagingException (sqle.getMessage(), sqle);
      }
    }

    if (DebugFile.trace) {
      DebugFile.decIdent();
View Full Code Here

Examples of javax.mail.MessagingException

          sRetVal = super.getSubject();
        else
          sRetVal = (String) oHeaders.get("Subject");
      }
      catch (SQLException sqle) {
        throw new MessagingException (sqle.getMessage(), sqle);
      }
    }

    if (DebugFile.trace) {
      DebugFile.decIdent();
View Full Code Here

Examples of javax.mail.MessagingException

     else if (sContentClass.equals("java.lang.String")) {
       oRetVal = new MimeBodyPart();
       oRetVal.setText((String) oContent);
     }
     else {
       throw new MessagingException("Unparsed Mime Content " + oContent.getClass().getName());
     }

     if (null==oRetVal) {
       oRetVal = new MimeBodyPart();
       oRetVal.setText("");
View Full Code Here

Examples of javax.mail.MessagingException

      }
      catch (SQLException e) {
        if (null!=oConn) { try { oConn.rollback(); } catch (Exception ignore) {} }
        if (null!=oUpdt) { try { oUpdt.close(); } catch (Exception ignore) {} }
        if (DebugFile.trace) DebugFile.decIdent();
        throw new MessagingException(e.getMessage(), e);
      }
    }
  } // setFlag
View Full Code Here

Examples of javax.mail.MessagingException

        oConn=null;
      }
      catch (SQLException e) {
        if (null!=oConn) { try { oConn.rollback(); } catch (Exception ignore) {} }
        if (DebugFile.trace) DebugFile.decIdent();
        throw new MessagingException(e.getMessage(), e);
      }
    }
    else {
      super.saveChanges();
    }
View Full Code Here

Examples of javax.mail.MessagingException

        oStmt = null;

      } catch (SQLException sqle) {
        try { if (oRSet!=null) oRSet.close(); } catch (Exception e) {}
        try { if (oStmt!=null) oStmt.close(); } catch (Exception e) {}
        throw new MessagingException(sqle.getMessage(), sqle);
      }
      oRetVal = oMultiPart;
    }
    else {
      oRetVal = (MimeMultipart) super.getContent();
View Full Code Here

Examples of javax.mail.MessagingException

       oPipe.between(oInStrm, oBaStrm);
       oRetVal = new MimeBodyPart();
       oRetVal.setText(oBaStrm.toString("ISO8859_1"));
     }
     else {
       throw new MessagingException("Unparsed Mime Content " + oContent.getClass().getName());
     }

     if (null==oRetVal) {
       oRetVal = new MimeBodyPart();
       oRetVal.setText("");
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.