当前位置: 首页>>代码示例>>Java>>正文


Java Field类代码示例

本文整理汇总了Java中org.apache.james.mime4j.stream.Field的典型用法代码示例。如果您正苦于以下问题:Java Field类的具体用法?Java Field怎么用?Java Field使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Field类属于org.apache.james.mime4j.stream包,在下文中一共展示了Field类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getContentId

import org.apache.james.mime4j.stream.Field; //导入依赖的package包/类
@Override
public String getContentId (final Entity entity)
{
    final Header header = entity.getHeader();

    if (header == null)
    {
        return null;
    }

    final Field field = header.getField(FieldName.CONTENT_ID);

    if (field == null)
    {
        return null;
    }

    // todo this is going to be a PITA to test because of ContentIdFieldImpl.
    // todo Inject a FieldParser<ContentIdField> (then use ContentIdFieldImpl.PARSER in MimeUIFactory).

    return getUnbracketedContentId(ContentIdFieldImpl.PARSER.parse(field, null).getId());
}
 
开发者ID:QSFT,项目名称:MimeUI,代码行数:23,代码来源:Mime4jEntityHandler.java

示例2: field

import org.apache.james.mime4j.stream.Field; //导入依赖的package包/类
@Override
public void field(Field parsedField) throws MimeException {
    expect(Part.class);
    // We need the original, unparsed header values for PGP/MIME signature calculation
    byte[] rawByteValue = null;
    byte[] rawBytes = parsedField.getRaw().toByteArray();
	String raw = new String( rawBytes );
	if( raw.length() > 0 ) {

		int index = raw.indexOf( ":" );
		if( index != -1 && raw.length() > index+2 ) {
			rawByteValue = raw.substring( index+2 ).getBytes();
		}

	}

    try {
        ((Part)stack.peek()).addHeader(parsedField.getName(), parsedField.getBody().trim(), rawByteValue);
    } catch (MessagingException me) {
        throw new Error(me);
    }
}
 
开发者ID:thialfihar,项目名称:k-9,代码行数:23,代码来源:MimeMessage.java

示例3: field

import org.apache.james.mime4j.stream.Field; //导入依赖的package包/类
@Override
public void field(Field parsedField) throws MimeException {
    String name = parsedField.getName();
    String raw = parsedField.getRaw().toString();

    Part part = (Part) stack.peek();
    part.addRawHeader(name, raw);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:9,代码来源:MimePartStreamParser.java

示例4: field

import org.apache.james.mime4j.stream.Field; //导入依赖的package包/类
@Override
public void field(Field parsedField) throws MimeException {
    expect(Part.class);
    String name = parsedField.getName();
    String raw = parsedField.getRaw().toString();
    ((Part) stack.peek()).addRawHeader(name, raw);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:8,代码来源:MimeMessage.java

示例5: getEmailSubject

import org.apache.james.mime4j.stream.Field; //导入依赖的package包/类
public String getEmailSubject(){
	Field subjectField = header.getField("Subject");	
	if (subjectField != null) {
		Field decodedSubjectField = new CustomUnstructuredFieldImpl(subjectField,DecodeMonitor.SILENT);
		return ((CustomUnstructuredFieldImpl)decodedSubjectField).getValue();
	}
	return null;
}
 
开发者ID:ram-sharma-6453,项目名称:email-mime-parser,代码行数:9,代码来源:Email.java

示例6: getToEmailHeaderValue

import org.apache.james.mime4j.stream.Field; //导入依赖的package包/类
public String getToEmailHeaderValue() {
	Field to = header.getField("To");
	if (to != null) {
		return to.getBody();
	}
	return null;
}
 
开发者ID:ram-sharma-6453,项目名称:email-mime-parser,代码行数:8,代码来源:Email.java

示例7: getCCEmailHeaderValue

import org.apache.james.mime4j.stream.Field; //导入依赖的package包/类
public String getCCEmailHeaderValue(){
	Field cc = header.getField("Cc");	
	if (cc != null) {
		return cc.getBody();
	}
	return null;
}
 
开发者ID:ram-sharma-6453,项目名称:email-mime-parser,代码行数:8,代码来源:Email.java

示例8: getFromEmailHeaderValue

import org.apache.james.mime4j.stream.Field; //导入依赖的package包/类
public String getFromEmailHeaderValue(){
	Field from = header.getField("From");	
	if (from != null) {			
		return from.getBody();
	}
	return null;
}
 
开发者ID:ram-sharma-6453,项目名称:email-mime-parser,代码行数:8,代码来源:Email.java

示例9: assertGettingHeader

import org.apache.james.mime4j.stream.Field; //导入依赖的package包/类
private void assertGettingHeader(String header)
        throws MimeException, IOException {

    Email email = getParsedSimpleGmail();
    Header parsedHeader = email.getHeader();

    Field from = parsedHeader.getField(header);
    Assert.assertEquals(header, from.getName());
}
 
开发者ID:ram-sharma-6453,项目名称:email-mime-parser,代码行数:10,代码来源:EmailVerificationTest.java

示例10: field

import org.apache.james.mime4j.stream.Field; //导入依赖的package包/类
@Override
public void field(Field parsedField) throws MimeException {
    expect(Part.class);
    try {
        ((Part)stack.peek()).addHeader(parsedField.getName(), parsedField.getBody().trim());
    } catch (MessagingException me) {
        throw new Error(me);
    }
}
 
开发者ID:daxslab,项目名称:daxSmail,代码行数:10,代码来源:MimeMessage.java

示例11: stripOutFieldPrefix

import org.apache.james.mime4j.stream.Field; //导入依赖的package包/类
private String stripOutFieldPrefix(Field field, String fieldname) {
    String temp = field.getRaw().toString();
    int loc = fieldname.length();
    while (temp.charAt(loc) ==' ') {
        loc++;
    }
    return temp.substring(loc);
}
 
开发者ID:kolbasa,项目名称:OCRaptor,代码行数:9,代码来源:MailContentHandler.java

示例12: getMessageHeaders

import org.apache.james.mime4j.stream.Field; //导入依赖的package包/类
/**
   * Extract only those header fields that are listed in MessageHeader
* All keys are lower-cased.
   *
   * @param message
   * @return
   */
  public static Map<String, Field> getMessageHeaders(Message message) {
      Map<String, Field> h = new HashMap<String, Field>();
      for (Field f : message.getHeader().getFields()) {
          if (MessageHeader.IGNORE.equals(MessageHeader.getValue(f.getName().toLowerCase()))) {
              continue;
          }
          h.put(f.getName().toLowerCase(), f);
      }
      return h;
  }
 
开发者ID:searchisko,项目名称:mbox_tools,代码行数:18,代码来源:MessageParser.java

示例13: createNode

import org.apache.james.mime4j.stream.Field; //导入依赖的package包/类
/**
 * Create a node given a Multipart body.
 * Add the Preamble, all Body parts and the Epilogue to the node.
 *
 * @param multipart the Multipart.
 * @return the root node of the tree.
 */
private DefaultMutableTreeNode createNode(Header header) {
    DefaultMutableTreeNode node = new DefaultMutableTreeNode(
            new ObjectWrapper("Header", header));

    for (Field field : header.getFields()) {
        String name = field.getName();

        node.add(new DefaultMutableTreeNode(new ObjectWrapper(name, field)));
    }

    return node;
}
 
开发者ID:xuzhikethinker,项目名称:t4f-data,代码行数:20,代码来源:MessageTreeViewMain.java

示例14: field

import org.apache.james.mime4j.stream.Field; //导入依赖的package包/类
@Override
public void field(Field rawField) throws MimeException {
    String name = rawField.getName();
    String raw = rawField.getRaw().toString();
    part.addRawHeader(name, raw);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:7,代码来源:MessageHeaderParser.java

示例15: CustomUnstructuredFieldImpl

import org.apache.james.mime4j.stream.Field; //导入依赖的package包/类
public CustomUnstructuredFieldImpl(Field rawField, DecodeMonitor monitor) {
    super(rawField, monitor);
}
 
开发者ID:ram-sharma-6453,项目名称:email-mime-parser,代码行数:4,代码来源:CustomUnstructuredFieldImpl.java


注:本文中的org.apache.james.mime4j.stream.Field类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。