untitled1.java~4~

来自「Contains a complete archiver by Haruhiko」· JAVA~4~ 代码 · 共 47 行

JAVA~4~
47
字号
package ejb;

public class Untitled1 {
  public Untitled1() {
  }

  public static void main(String[] args) {

  }
  public String getPart(Part part, int partNum)
  2 throws MessagingException,IOException
  3 {
  4 String s="";
  5 String s1="";
  6 String s2="";
  7 String s3="";
  8 String sct = part.getContentType();
  9 if (sct == null)
  10 {
  11 s="part 无效";
  12 return s;
  13 }
  14 ContentType ct = new ContentType(sct);
  15 if (ct.match("text/plain"))
  16 {
  17 // display text/plain inline
  18 s1="
  "+(String)part.getContent()+"
  ";
  19 }
  20 else
  21 {
  22 String temp="";
  23 if ((temp = part.getFileName()) != null)
  24 s2= "Filename: " + temp + "
  ";
  25 temp = null;
  26 if ((temp = part.getDescription()) != null)
  27 s3= "Description: " + temp + "
  ";
  28 }
  29 s=s1+s2+s3;
  30 return s;
  31 }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?