Package javax.mail

Examples of javax.mail.MessagingException


        oRetVal.getCategory().load(oConn, new Object[] {sGuid});
      }
    }
    catch (SQLException sqle) {
      if (DebugFile.trace) DebugFile.decIdent();
      throw new MessagingException(sqle.getMessage(), sqle);
    }

    if (DebugFile.trace) {
      DebugFile.decIdent();
      DebugFile.writeln("End DBStore.getFolder("+sFolderName+")");
View Full Code Here


          aRetVal[f] = oFR;
        } // next
      } // fi
    }
    catch (SQLException sqle) {
      throw new MessagingException(sqle.getMessage(), sqle);
    }
    return aRetVal;
  }
View Full Code Here

          aRetVal[f] = oFR;
        } // next
      } // fi
    }
    catch (SQLException sqle) {
      throw new MessagingException(sqle.getMessage(), sqle);
    }
    return aRetVal;
  } // getUserNamespaces
View Full Code Here

      DebugFile.writeln("Begin DBStore.preFetchMessage([Folder],"+String.valueOf(iMsgNum)+")");
      DebugFile.incIdent();
    }

    if (null==oIncomingFldr)
      throw new MessagingException("Unable to open inbox folder",
                                   new NullPointerException("DBStore.preFetchMessage() Folder is null"));

    boolean bWasConnected = isConnected();
    if (!bWasConnected) connect();
    DBFolder oInboxFldr = (DBFolder) getDefaultFolder();
View Full Code Here

    BodyPart oRetVal = null;
    try {
      oRetVal = (BodyPart) aParts.get(index);
    }
    catch (ArrayIndexOutOfBoundsException aiob) {
      throw new MessagingException("Invalid message part index", aiob);
    }
    return oRetVal;
  }
View Full Code Here

      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

      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

          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

          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

          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

TOP

Related Classes of javax.mail.MessagingException

Copyright © 2018 www.massapicom. 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.