@Test public void extractInfoForDb__withNoBody__shouldReturnContentAvailable() throws Exception { MimeBodyPart part = new MimeBodyPart(); part.setBody(new TextBody("data")); AttachmentViewInfo attachmentViewInfo = attachmentInfoExtractor.extractAttachmentInfoForDatabase(part); assertTrue(attachmentViewInfo.isContentAvailable()); }
public AttachmentViewInfo extractAttachmentInfoForDatabase(Part part) throws MessagingException { boolean isContentAvailable = part.getBody() != null; return extractAttachmentInfo(part, Uri.EMPTY, AttachmentViewInfo.UNKNOWN_SIZE, isContentAvailable); }
AttachmentInfoExtractor { public AttachmentViewInfo extractAttachmentInfoForDatabase(Part part) throws MessagingException { boolean isContentAvailable = part.getBody() != null; return extractAttachmentInfo(part, Uri.EMPTY, AttachmentViewInfo.UNKNOWN_SIZE, isContentAvailable); } }
AttachmentInfoExtractor { public AttachmentViewInfo extractAttachmentInfoForDatabase(Part part) throws MessagingException { boolean isContentAvailable = part.getBody() != null; return extractAttachmentInfo(part, Uri.EMPTY, AttachmentViewInfo.UNKNOWN_SIZE, isContentAvailable); } @VisibleForTesting  AttachmentInfoExtractor(Context context); }
AttachmentInfoExtractor { public AttachmentViewInfo extractAttachmentInfoForDatabase(Part part) throws MessagingException { boolean isContentAvailable = part.getBody() != null; return extractAttachmentInfo(part, Uri.EMPTY, AttachmentViewInfo.UNKNOWN_SIZE, isContentAvailable); } @VisibleForTesting  AttachmentInfoExtractor(Context context); static AttachmentInfoExtractor getInstance(); @WorkerThread List<AttachmentViewInfo> extractAttachmentInfoForView(List<Part> attachmentParts); @WorkerThread AttachmentViewInfo extractAttachmentInfo(Part part); AttachmentViewInfo extractAttachmentInfoForDatabase(Part part); }
AttachmentInfoExtractor { public AttachmentViewInfo extractAttachmentInfoForDatabase(Part part) throws MessagingException { boolean isContentAvailable = part.getBody() != null; return extractAttachmentInfo(part, Uri.EMPTY, AttachmentViewInfo.UNKNOWN_SIZE, isContentAvailable); } @VisibleForTesting  AttachmentInfoExtractor(Context context); static AttachmentInfoExtractor getInstance(); @WorkerThread List<AttachmentViewInfo> extractAttachmentInfoForView(List<Part> attachmentParts); @WorkerThread AttachmentViewInfo extractAttachmentInfo(Part part); AttachmentViewInfo extractAttachmentInfoForDatabase(Part part);  }