Package org.apache.james.mime4j.field

Examples of org.apache.james.mime4j.field.ContentTypeField$Parser


        Header header = parent.getHeader();
        if (header == null)
            throw new IllegalArgumentException(
                    "Missing header in parent entity");

        ContentTypeField contentType = (ContentTypeField) header
                .getField(FieldName.CONTENT_TYPE);
        if (contentType == null)
            throw new IllegalArgumentException(
                    "Content-Type field not specified");
View Full Code Here


     * Content-Type field is set for this <code>Entity</code>.
     *
     * @return the MIME type.
     */
    public String getMimeType() {
        ContentTypeField child =
            (ContentTypeField) getHeader().getField(FieldName.CONTENT_TYPE);
        ContentTypeField parent = getParent() != null
            ? (ContentTypeField) getParent().getHeader().
                                                getField(FieldName.CONTENT_TYPE)
            : null;
       
        return ContentTypeField.getMimeType(child, parent);
View Full Code Here

     * method returns <code>false</code> if no boundary exists.
     *
     * @return <code>true</code> on match, <code>false</code> otherwise.
     */
    public boolean isMultipart() {
        ContentTypeField f =
            (ContentTypeField) getHeader().getField(FieldName.CONTENT_TYPE);
        return f != null && f.getBoundary() != null
            && getMimeType().startsWith(ContentTypeField.TYPE_MULTIPART_PREFIX);
    }
View Full Code Here

     *
     * @return boundery
     */
    private String getBoundary() {
        Entity e = getParent();
        ContentTypeField cField = (ContentTypeField) e.getHeader().getField(
                Field.CONTENT_TYPE);
        return cField.getBoundary();
    }
View Full Code Here

     * Content-Type field is set for this <code>Entity</code>.
     *
     * @return the MIME type.
     */
    public String getMimeType() {
        ContentTypeField child =
            (ContentTypeField) getHeader().getField(Field.CONTENT_TYPE);
        ContentTypeField parent = getParent() != null
            ? (ContentTypeField) getParent().getHeader().
                                                getField(Field.CONTENT_TYPE)
            : null;
       
        return ContentTypeField.getMimeType(child, parent);
View Full Code Here

     * method returns <code>false</code> if no boundary exists.
     *
     * @return <code>true</code> on match, <code>false</code> otherwise.
     */
    public boolean isMultipart() {
        ContentTypeField f =
            (ContentTypeField) getHeader().getField(Field.CONTENT_TYPE);
        return f != null && f.getBoundary() != null
            && getMimeType().startsWith(ContentTypeField.TYPE_MULTIPART_PREFIX);
    }
View Full Code Here

  }

  @Override
  public void parse(InputStream is) throws IOException {
    super.parse(is);
    ContentTypeField contentTypeField = (ContentTypeField) mimeMessage
        .getHeader().getField(FieldName.CONTENT_TYPE);
    start = contentTypeField.getParameter("start");
    startInfo = contentTypeField.getParameter("start-info");
    type = contentTypeField.getParameter("type");
    rootPart = start == null ? getParts().get(0) : relatedMap.get(start);
  }
View Full Code Here

  private ManifestParseTree parse(InputStream inputStream) throws IOException, TokenizerException, ParserException {
    Preprocessor preprocessor = new ManifestPreprocessor();
    List<InputLine> contents = preprocessor.process(inputStream);
    Tokenizer tokenizer = new ManifestTokenizer(contents);

    Parser parser = new ManifestParser();
    return parser.parse(tokenizer);
  }
View Full Code Here

  private ManifestParseTree parse(InputStream inputStream) throws IOException, TokenizerException, ParserException {
    Preprocessor preprocessor = new ManifestPreprocessor();
    List<InputLine> contents = preprocessor.process(inputStream);
    Tokenizer tokenizer = new ManifestTokenizer(contents);

    Parser parser = new ManifestParser();
    return parser.parse(tokenizer);
  }
View Full Code Here

TOP

Related Classes of org.apache.james.mime4j.field.ContentTypeField$Parser

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.