@Override protected InputPart extractPart(BodyPart bodyPart) throws IOException { InputPart inputPart = super.extractPart(bodyPart); relatedMap .put(inputPart.getHeaders().getFirst("Content-ID"), inputPart); return inputPart; }
public MultipartInputImpl(final Multipart multipart, final Providers workers) throws IOException { for (BodyPart bodyPart : multipart.getBodyParts()) parts.add(extractPart(bodyPart)); this.workers = workers; }
protected void extractParts() throws IOException { Multipart multipart = (Multipart) mimeMessage.getBody(); for (BodyPart bodyPart : multipart.getBodyParts()) parts.add(extractPart(bodyPart)); }
@Override protected InputPart extractPart(BodyPart bodyPart) throws IOException { InputPart currPart = super.extractPart(bodyPart); Field disposition = bodyPart.getHeader().getField( FieldName.CONTENT_DISPOSITION); if (disposition == null) throw new RuntimeException(Messages.MESSAGES.couldFindNoContentDispositionHeader()); if (disposition instanceof ContentDispositionField) { String name = ((ContentDispositionField) disposition) .getParameter("name"); List<InputPart> list = formDataMap.get(name); if (list == null) { list = new LinkedList<InputPart>(); formDataMap.put(name, list); } list.add(currPart); } else { throw new RuntimeException(Messages.MESSAGES.couldNotParseContentDisposition(disposition)); } return currPart; }
@Override protected InputPart extractPart(BodyPart bodyPart) throws IOException { InputPart inputPart = super.extractPart(bodyPart); relatedMap .put(inputPart.getHeaders().getFirst("Content-ID"), inputPart); return inputPart; }
public MultipartInputImpl(Multipart multipart, Providers workers) throws IOException { for (BodyPart bodyPart : multipart.getBodyParts()) parts.add(extractPart(bodyPart)); this.workers = workers; }
protected void extractParts() throws IOException { Multipart multipart = (Multipart) mimeMessage.getBody(); for (BodyPart bodyPart : multipart.getBodyParts()) parts.add(extractPart(bodyPart)); }
@Override protected InputPart extractPart(BodyPart bodyPart) throws IOException { InputPart currPart = super.extractPart(bodyPart); Field disposition = bodyPart.getHeader().getField( FieldName.CONTENT_DISPOSITION); if (disposition == null) throw new RuntimeException(Messages.MESSAGES.couldFindNoContentDispositionHeader()); if (disposition instanceof ContentDispositionField) { String name = ((ContentDispositionField) disposition) .getParameter("name"); List<InputPart> list = formDataMap.get(name); if (list == null) { list = new LinkedList<InputPart>(); formData.put(name, currPart); formDataMap.put(name, list); } list.add(currPart); } else { throw new RuntimeException(Messages.MESSAGES.couldNotParseContentDisposition(disposition)); } return currPart; }