Package org.bouncycastle.mail.smime
Class SMIMEBoundaryNotFoundException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- javax.mail.MessagingException
-
- org.bouncycastle.mail.smime.SMIMEBoundaryNotFoundException
-
- All Implemented Interfaces:
java.io.Serializable
public class SMIMEBoundaryNotFoundException extends javax.mail.MessagingExceptionMessagingException 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:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetBoundary()Return the boundary line being searched for (with its leading--).longgetBytesConsumed()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.intgetExpectedBoundaries()Return the number of boundary lines the scan was looking for.intgetFoundBoundaries()Return the number of boundary lines actually seen before end-of-stream.java.lang.StringgetLastLineRead()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.java.lang.StringgetParentContentDisposition()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.java.lang.StringgetParentContentType()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, toString
-
-
-
-
Method Detail
-
getBoundary
public java.lang.String getBoundary()
Return the boundary line being searched for (with its leading--).
-
getParentContentType
public java.lang.String getParentContentType()
Return the Content-Type of the body part whose raw content was being scanned, or null if it could not be determined.
-
getParentContentDisposition
public java.lang.String 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
public java.lang.String 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.
-
-