⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 untitled1.java~8~

📁 Contains a complete archiver by Haruhiko Okumura. The archiver uses an LZ engine whose output is c
💻 JAVA~8~
字号:
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 = "";
    x参数来确定是以html格式显示还是以plain
        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 + -