In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Most people do not understand the knowledge points of this article "how to solve Chinese name garbled attached in Javamail", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to solve Chinese name garbled attached in Javamail" article.
First of all, determine whether the body of the message has an attachment:
Object out_content = message.getContent ()
If (! (out_content instanceof Multipart)) {/ / is not a composite mail body without attachments.
Partname = new String [0]
Return partname
}
If it is a composite mail body, you can call the following method to get the Chinese file name:
Public static String getISOFileName (Part body) {
/ / set a flag to determine whether the file name is obtained from Content-Disposition or Content-Type
Boolean flag=true
If (body==null) {
Return null
}
String [] cdis
Try {
Cdis=body.getHeader ("Content-Disposition")
}
Catch (Exception e) {
Return null
}
If (cdis==null) {
Flag=false
}
If (! flag) {
Try {
Cdis=body.getHeader ("Content-Type")
}
Catch (Exception e) {
Return null
}
}
If (cdis==null) {
Return null
}
If (cdis [0] = = null) {
Return null
}
/ / get the file name from Content-Disposition
If (flag) {
Int pos=cdis [0] .indexOf ("filename=")
If (pos
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.