📄 jfmemailpart.java
字号:
/* * Created on 2004.08.19 * JFreeMail - Java mail component * Copyright (C) 2004 Dalibor Krleza * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.jfreemail.core;/** * Java bean superclass for all E-mail parts. Do not use this class directly. * Use JfmEmailTextPart and JfmEmailBinaryPart instead. Most of methods * in this class are protected and cannot be used. */public class JfmEmailPart { private String __content_type=null; private String __content_encoding=null; private String __content_charset=null; private String __content_name=null; private String[] __text_message=null; private byte[] __binary_message=null; /** * Constructor for E-mail part. Do not use this constructor to construct * object. * */ public JfmEmailPart() { __content_type=new String(); __content_encoding=new String(); __content_charset=new String(); __content_name=new String(); } protected String getContentType() { return __content_type; } protected void setContentType(String content_type) throws CoreException { __content_type=content_type; } protected String getContentCharset() { return __content_charset; } protected void setContentCharset(String charset) { __content_charset=charset; } protected String getContentEncoding() { return __content_encoding; } protected void setContentEncoding(String encoding) { __content_encoding=encoding; } protected String getContentName() { return __content_name; } protected void setContentName(String name) { __content_name=name; } protected String[] getTextContent() { return __text_message; } protected void setTextContent(String[] content) throws CoreException { if (__content_type==null) throw new CoreException("COR_001:No content type in email part"); if (__content_charset==null) throw new CoreException("COR_001:No content charset in email part"); if (!JfmCore.checkTextType(__content_type)) throw new CoreException("COR_002:Wrong content type. Should be text/*"); __text_message=content; } protected byte[] getBinaryContent() { return __binary_message; } protected void setBinaryContent(byte[] content) throws CoreException { if (__content_type==null) throw new CoreException("COR_001:No content type in email part"); if (__content_encoding==null) throw new CoreException("COR_001:No content encoding in email part"); if (__content_name==null) throw new CoreException("COR_001:No content name in email part"); if (JfmCore.checkTextType(__content_type)) throw new CoreException("COR_002:Wrong content type. Should be binary type"); __binary_message=content; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -