本文整理了Java中javax.mail.internet.MimeMessage.getFileName()
方法的一些代码示例,展示了MimeMessage.getFileName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MimeMessage.getFileName()
方法的具体详情如下:
包路径:javax.mail.internet.MimeMessage
类名称:MimeMessage
方法名:getFileName
[英]Get the filename associated with this Message.
Returns the value of the "filename" parameter from the "Content-Disposition" header field of this message. If it's not available, returns the value of the "name" parameter from the "Content-Type" header field of this BodyPart. Returns null
if both are absent.
If the mail.mime.encodefilename
System property is set to true, the MimeUtility#decodeText method will be used to decode the filename. While such encoding is not supported by the MIME spec, many mailers use this technique to support non-ASCII characters in filenames. The default value of this property is false.
[中]获取与此消息关联的文件名。
从该消息的“内容处置”标题字段返回“filename”参数的值。如果不可用,则从该BodyPart的“Content Type”标题字段返回“name”参数的值。如果两者都不存在,则返回null
。
如果mail.mime.encodefilename
系统属性设置为true,则将使用MimeUtility#decodeText方法对文件名进行解码。虽然MIME规范不支持这种编码,但许多邮件程序使用这种技术来支持文件名中的非ASCII字符。此属性的默认值为false。
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Get the "filename" Disposition parameter. (Only available in
* IMAP4rev1). If thats not available, get the "name" ContentType
* parameter.
*/
public String getFileName() throws MessagingException {
checkExpunged();
if (bodyLoaded)
return super.getFileName();
String filename = null;
loadBODYSTRUCTURE();
if (bs.dParams != null)
filename = bs.dParams.get("filename");
if (filename == null && bs.cParams != null)
filename = bs.cParams.get("name");
return filename;
}
代码示例来源:origin: com.sun.mail/javax.mail
/**
* Get the "filename" Disposition parameter. (Only available in
* IMAP4rev1). If thats not available, get the "name" ContentType
* parameter.
*/
@Override
public String getFileName() throws MessagingException {
checkExpunged();
if (bodyLoaded)
return super.getFileName();
String filename = null;
loadBODYSTRUCTURE();
if (bs.dParams != null)
filename = bs.dParams.get("filename");
if (filename == null && bs.cParams != null)
filename = bs.cParams.get("name");
return filename;
}
代码示例来源:origin: org.apache.james/james-server-core-library
/**
* @see javax.mail.Part#getFileName()
*/
public String getFileName() throws MessagingException {
return getWrappedMessage().getFileName();
}
代码示例来源:origin: com.sun.mail/jakarta.mail
/**
* Get the "filename" Disposition parameter. (Only available in
* IMAP4rev1). If thats not available, get the "name" ContentType
* parameter.
*/
@Override
public String getFileName() throws MessagingException {
checkExpunged();
if (bodyLoaded)
return super.getFileName();
String filename = null;
loadBODYSTRUCTURE();
if (bs.dParams != null)
filename = bs.dParams.get("filename");
if (filename == null && bs.cParams != null)
filename = bs.cParams.get("name");
return filename;
}
代码示例来源:origin: com.sun.mail/android-mail
/**
* Get the "filename" Disposition parameter. (Only available in
* IMAP4rev1). If thats not available, get the "name" ContentType
* parameter.
*/
@Override
public String getFileName() throws MessagingException {
checkExpunged();
if (bodyLoaded)
return super.getFileName();
String filename = null;
loadBODYSTRUCTURE();
if (bs.dParams != null)
filename = bs.dParams.get("filename");
if (filename == null && bs.cParams != null)
filename = bs.cParams.get("name");
return filename;
}
代码示例来源:origin: org.glassfish.metro/webservices-extra
/**
* Get the "filename" Disposition parameter. (Only available in
* IMAP4rev1). If thats not available, get the "name" ContentType
* parameter.
*/
@Override
public String getFileName() throws MessagingException {
checkExpunged();
if (bodyLoaded)
return super.getFileName();
String filename = null;
loadBODYSTRUCTURE();
if (bs.dParams != null)
filename = bs.dParams.get("filename");
if (filename == null && bs.cParams != null)
filename = bs.cParams.get("name");
return filename;
}
代码示例来源:origin: jboss/jboss-javaee-specs
/**
* Get the "filename" Disposition parameter. (Only available in
* IMAP4rev1). If thats not available, get the "name" ContentType
* parameter.
*/
@Override
public String getFileName() throws MessagingException {
checkExpunged();
if (bodyLoaded)
return super.getFileName();
String filename = null;
loadBODYSTRUCTURE();
if (bs.dParams != null)
filename = bs.dParams.get("filename");
if (filename == null && bs.cParams != null)
filename = bs.cParams.get("name");
return filename;
}
代码示例来源:origin: org.apache.james/apache-standard-mailets
String fileName = message.getFileName();
if (fileName != null) {
return mail.getRecipients(); // file found
代码示例来源:origin: org.codelibs.fess/fess-crawler
putValue(data, "Disposition", message.getDisposition());
putValue(data, "Encoding", message.getEncoding());
putValue(data, "File-Name", message.getFileName());
putValue(data, "From", message.getFrom());
putValue(data, "Line-Count", message.getLineCount());
代码示例来源:origin: org.codelibs.robot/s2-robot
putValue(data, "File-Name", message.getFileName());
} catch (Exception e) {
内容来源于网络,如有侵权,请联系作者删除!