private void downloadSaneBody(Folder remoteFolder, BackendFolder backendFolder, Message message) throws MessagingException { /* * The provider was unable to get the structure of the message, so * we'll download a reasonable portion of the messge and mark it as * incomplete so the entire thing can be downloaded later if the user * wishes to download it. */ FetchProfile fp = new FetchProfile(); fp.add(FetchProfile.Item.BODY_SANE); /* * TODO a good optimization here would be to make sure that all Stores set * the proper size after this fetch and compare the before and after size. If * they equal we can mark this SYNCHRONIZED instead of PARTIALLY_SYNCHRONIZED */ remoteFolder.fetch(Collections.singletonList(message), fp, null); // Store the updated message locally backendFolder.savePartialMessage(message); }
private void downloadPartial(Folder remoteFolder, BackendFolder backendFolder, Message message) throws MessagingException { /* * We have a structure to deal with, from which * we can pull down the parts we want to actually store. * Build a list of parts we are interested in. Text parts will be downloaded * right now, attachments will be left for later. */ Set<Part> viewables = MessageExtractor.collectTextParts(message); /* * Now download the parts we're interested in storing. */ BodyFactory bodyFactory = new DefaultBodyFactory(); for (Part part : viewables) { remoteFolder.fetchPart(message, part, null, bodyFactory); } // Store the updated message locally backendFolder.savePartialMessage(message); }
private void downloadPartial(Folder remoteFolder, BackendFolder backendFolder, Message message) throws MessagingException { /* * We have a structure to deal with, from which * we can pull down the parts we want to actually store. * Build a list of parts we are interested in. Text parts will be downloaded * right now, attachments will be left for later. */ Set<Part> viewables = MessageExtractor.collectTextParts(message); /* * Now download the parts we're interested in storing. */ BodyFactory bodyFactory = new DefaultBodyFactory(); for (Part part : viewables) { remoteFolder.fetchPart(message, part, null, bodyFactory); } // Store the updated message locally backendFolder.savePartialMessage(message); }
private void downloadPartial(Folder remoteFolder, BackendFolder backendFolder, Message message) throws MessagingException { /* * We have a structure to deal with, from which * we can pull down the parts we want to actually store. * Build a list of parts we are interested in. Text parts will be downloaded * right now, attachments will be left for later. */ Set<Part> viewables = MessageExtractor.collectTextParts(message); /* * Now download the parts we're interested in storing. */ BodyFactory bodyFactory = new DefaultBodyFactory(); for (Part part : viewables) { remoteFolder.fetchPart(message, part, null, bodyFactory); } // Store the updated message locally backendFolder.savePartialMessage(message); }
backendFolder.saveCompleteMessage(message); } else { backendFolder.savePartialMessage(message);
backendFolder.saveCompleteMessage(message); } else { backendFolder.savePartialMessage(message);
backendFolder.saveCompleteMessage(message); } else { backendFolder.savePartialMessage(message);
backendFolder.saveCompleteMessage(message); } else { backendFolder.savePartialMessage(message);