Package org.apache.james.mime4j.parser

Examples of org.apache.james.mime4j.parser.Field


        l.add(field);

        int firstOccurrence = -1;
        int index = 0;
        for (Iterator<Field> iterator = fields.iterator(); iterator.hasNext(); index++) {
            Field f = iterator.next();
            if (f.getName().equalsIgnoreCase(field.getName())) {
                iterator.remove();

                if (firstOccurrence == -1)
                    firstOccurrence = index;
            }
View Full Code Here


    /**
     * @see org.apache.james.mime4j.parser.ContentHandler#field(Field)
     */
    public void field(Field field) throws MimeException {
        expect(Header.class);
        Field parsedField = AbstractField.parse(field.getRaw());
        ((Header) stack.peek()).addField(parsedField);
    }
View Full Code Here

    /**
     * @see org.apache.james.mime4j.parser.AbstractContentHandler#field(Field)
     */
    @Override
    public final void field(Field field) throws MimeException {
        Field parsedField = AbstractField.parse(field.getRaw());
        currHeader.addField(parsedField);
    }
View Full Code Here

    private static <F extends Field> F parse(FieldParser parser,
            String fieldName, String fieldBody) {
        String rawStr = MimeUtil.fold(fieldName + ": " + fieldBody, 0);
        ByteSequence raw = ContentUtil.encode(rawStr);

        Field field = parser.parse(fieldName, fieldBody, raw);

        @SuppressWarnings("unchecked")
        F f = (F) field;
        return f;
    }
View Full Code Here

     * or <code>null</code> if it is not present.
     *
     * @return the identifier of this message.
     */
    public String getMessageId() {
        Field field = obtainField(FieldName.MESSAGE_ID);
        if (field == null)
            return null;

        return field.getBody();
    }
View Full Code Here

  }

  @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(
          "Could find no Content-Disposition header within part");
    if (disposition instanceof ContentDispositionField) {
View Full Code Here

TOP

Related Classes of org.apache.james.mime4j.parser.Field

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.