📄 untitled1.java~10~
字号:
package ejb;
public class Untitled1 {
public Untitled1() {
}
public static void main(String[] args) {
}
public String getPart(Part part, int partNum, int msgNum, int x)
throws MessagingException, IOException {
String s = "";
String s1 = "";
String s2 = "";
String s3 = "";
String s5 = "";
String sct = part.getContentType();
if (sct == null) {
s = "part 无效";
return s;
}
ContentType ct = new ContentType(sct);
if (ct.match("text/html") || ct.match("text/plain")) {
// display text/plain inline
s1 = "" + (String) part.getContent() + " ";
}
else if (partNum != 0) {
String temp = "";
if ( (temp = part.getFileName()) != null) {
s2 = "Filename: " + temp + " ";
}
}
if (part.isMimeType("multipart/alternative")) {
String s6 = "";
String s7 = "";
Multipart mp = (Multipart) part.getContent();
int count = mp.getCount();
for (int i = 0; i < count; i++) {
if (mp.getBodyPart(i).isMimeType("text/plain"))
s7 = getPart(mp.getBodyPart(i), i, 3, 2);
if (mp.getBodyPart(i).isMimeType("text/html"))
s6 = getPart(mp.getBodyPart(i), i, 3, 1);
}
if (x == 1) {
s5 = s6;
}
if (x == 2) {
s5 = s7;
}
return s5;
}
s = s1 + s2;
return s;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -