/** * Returns the Content-ID of this {@link Part}. Returns {@code null} if none present. * * @param part {@link Part} the Part to parse. * @return String containing content ID. * @throws MessagingException if there is a failure. * @see MimePart#getContentID() */ protected static String parseContentId(final Part part) throws MessagingException { if (part instanceof MimePart) { final MimePart mp = (MimePart) part; return mp.getContentID(); } else { return null; } }
final String cid = stripContentId(part.getContentID()); final DataSource ds = createDataSource(parent, part); if (cid != null)
/** * Returns the Content-ID of this {@link Part}. Returns {@code null} if none present. * * @param part {@link Part} the Part to parse. * @return String containing content ID. * @throws MessagingException if there is a failure. * @see MimePart#getContentID() */ protected static String parseContentId(final Part part) throws MessagingException { if (part instanceof MimePart) { final MimePart mp = (MimePart) part; return mp.getContentID(); } else { return null; } }
@SuppressWarnings("WeakerAccess") @Nullable public static String parseContentID(@Nonnull final MimePart currentPart) { try { return currentPart.getContentID(); } catch (final MessagingException e) { throw new MimeMessageParseException(MimeMessageParseException.ERROR_GETTING_CONTENT_ID, e); } }
appendBodyStructureValue(buffer, bodyPart.getContentID()); appendBodyStructureValue(buffer, bodyPart.getDescription()); appendBodyStructureValue(buffer, bodyPart.getEncoding());
this.attachmentList.put(part.getContentID(), ds); } else if (Part.INLINE.equalsIgnoreCase(part.getDisposition())) { this.cidMap.put(part.getContentID(), ds); } else { throw new IllegalStateException("invalid attachment type");
final String cid = stripContentId(part.getContentID()); final DataSource ds = createDataSource(parent, part); if (cid != null)
contentID = part.getContentID(); } catch (MessagingException me) {