Class SMIMEBoundaryNotFoundException
java.lang.Object
java.lang.Throwable
java.lang.Exception
javax.mail.MessagingException
org.bouncycastle.mail.smime.SMIMEBoundaryNotFoundException
- All Implemented Interfaces:
Serializable
public class SMIMEBoundaryNotFoundException
extends javax.mail.MessagingException
MessagingException thrown when the raw content of a multipart body part
does not contain the expected number of MIME boundary lines - typically a
multipart that is missing its closing
--<boundary>--
line, so the part cannot be re-serialised for digest calculation
(see github #2318).
The exception message carries structural diagnostics only (the boundary,
the body part's Content-Type / Content-Disposition, the expected and found
boundary-line counts, and the number of bytes consumed) and is safe to log
or forward as-is. The last (non-empty) line read before the failure, which
may contain message content and is therefore potentially confidential, is
deliberately excluded from the message and is only available through
getLastLineRead().
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturn the boundary line being searched for (with its leading--).longReturn the number of bytes consumed from the body part's raw input stream before end-of-stream, for correlation with a dump of the original message.intReturn the number of boundary lines the scan was looking for.intReturn the number of boundary lines actually seen before end-of-stream.Return the last non-empty line read before the scan hit end-of-stream, truncated to 200 characters, or null if no non-empty line was seen.Return the Content-Disposition of the body part whose raw content was being scanned, or null if the header is absent or could not be read.Return the Content-Type of the body part whose raw content was being scanned, or null if it could not be determined.Methods inherited from class javax.mail.MessagingException
getCause, getNextException, setNextException, toStringMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Method Details
-
getBoundary
Return the boundary line being searched for (with its leading--). -
getParentContentType
Return the Content-Type of the body part whose raw content was being scanned, or null if it could not be determined. -
getParentContentDisposition
Return the Content-Disposition of the body part whose raw content was being scanned, or null if the header is absent or could not be read. -
getExpectedBoundaries
public int getExpectedBoundaries()Return the number of boundary lines the scan was looking for. -
getFoundBoundaries
public int getFoundBoundaries()Return the number of boundary lines actually seen before end-of-stream. -
getBytesConsumed
public long getBytesConsumed()Return the number of bytes consumed from the body part's raw input stream before end-of-stream, for correlation with a dump of the original message. -
getLastLineRead
Return the last non-empty line read before the scan hit end-of-stream, truncated to 200 characters, or null if no non-empty line was seen.This value is part of the message body and may be confidential. It is excluded from
Throwable.getMessage()so that stack traces are safe to log by default; only forward it to sinks cleared for message content.
-