001 /*
002 * Copyright 2010 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package com.hs.mail.imap.processor.fetch;
017
018 import org.apache.james.mime4j.parser.MimeEntityConfig;
019 import org.apache.james.mime4j.parser.MimeTokenStream;
020
021 /**
022 *
023 * @author Won Chul Doh
024 * @since Oct 3, 2010
025 *
026 */
027 public class MimeParser extends MimeTokenStream {
028
029 protected MimeParser(MimeEntityConfig config) {
030 super(config);
031 }
032
033 public static final MimeTokenStream createMaximalDescriptorParser() {
034 MimeEntityConfig config = new MimeEntityConfig();
035 config.setMaximalBodyDescriptor(true);
036 config.setMaxLineLen(-1);
037 return new MimeParser(config);
038 }
039
040 public static final MimeTokenStream createDefaultMimeParser() {
041 MimeEntityConfig config = new MimeEntityConfig();
042 config.setMaxLineLen(-1);
043 return new MimeParser(config);
044 }
045
046 }