コード例 #1
0
ファイル: UserHomePalette.java プロジェクト: jeeeyul/swtend
  public UserHomePalette(String name) {
    String userDir = System.getProperty("user.home");
    file = new File(userDir, name);

    if (file.exists()) {
      FileInputStream fis;
      try {
        fis = new FileInputStream(file);
        String content = StringUtil.read(fis, "UTF-8");
        String[] segmemts = content.split("\\s*[\r\n]+\\s*");
        for (String each : segmemts) {
          each = each.trim();
          if (each.length() == 0) {
            continue;
          }
          data.add(HSB.deserialize(each));
        }
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }