コード例 #1
0
ファイル: Updater.java プロジェクト: tigerich/yawl
 protected void consolidateLibDir(File tomcatRoot) {
   Set<String> requiredLibs = _differ.getRequiredLibNames();
   for (String lib : _differ.getInstalledLibNames()) {
     if (lib.startsWith("h2-")) continue; // h2 db driver is also needed
     if (!requiredLibs.contains(lib)) {
       FileUtil.delete(tomcatRoot, FileUtil.buildPath("yawllib", lib));
     }
   }
 }
コード例 #2
0
ファイル: Updater.java プロジェクト: tigerich/yawl
 protected List<AppUpdate> getInstallList(List<UpdateRow> updateRows) {
   List<AppUpdate> upList = new ArrayList<AppUpdate>();
   for (UpdateRow row : updateRows) {
     String appName = row.getName();
     if (row.isAdding()) {
       upList.add(_differ.getAppFiles(appName, true));
       upList.add(_differ.getAppLibs(appName));
     } else if (row.isRemoving()) {
       upList.add(_differ.getAppFiles(appName, false));
     }
   }
   return upList;
 }
コード例 #3
0
  @Override
  public boolean check(
      Differ owner, int lineLocation, int patchedPosition, int unpatchedPosition, int index) {
    Line targetLine = owner.getLine(lineLocation);

    //		android.util.Log.v("kiyo","##check#A#"+owner.length()+","+lineLocation);
    try {
      if (targetLine instanceof DeleteLine) {
        try {
          save(unpatchedPosition, patchedPosition, (DeleteLine) targetLine);
        } catch (FaileSaveException e) {
          e.printStackTrace();
        }
      } else if (targetLine instanceof AddLine) {
        try {
          save(unpatchedPosition, patchedPosition, (AddLine) targetLine);
        } catch (FaileSaveException e) {
          e.printStackTrace();
        }
      }
      //			android.util.Log.v("kiyo","##check#B#"+owner.length()+","+lineLocation);
    } finally {
      mPrevPatchedPosition = patchedPosition;
      mPrevUnpatchedPosition = unpatchedPosition;
    }
    return true;
  }
コード例 #4
0
ファイル: Updater.java プロジェクト: tigerich/yawl
 protected List<AppUpdate> getUpdatesList() {
   try {
     return _differ.getUpdatesList();
   } catch (IllegalStateException ise) {
     showError(ise.getMessage());
     return Collections.emptyList();
   }
 }
コード例 #5
0
ファイル: Updater.java プロジェクト: tigerich/yawl
  private void restartApp() {
    if (!updateThis()) {
      JOptionPane.showMessageDialog(
          getProgressPanel().getParent(),
          "The update has completed successfully, but the control panel "
              + "was unable to restart itself automatically. Please close then "
              + "restart the control panel manually to use the updated version.",
          "Update Completed",
          JOptionPane.WARNING_MESSAGE);
      return;
    }
    String javaBin =
        System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";
    try {
      String appPath = FileUtil.getJarFile().getPath();
      String newJarName = _differ.getNewJarName();
      if (!(newJarName == null || appPath.endsWith(newJarName))) {
        appPath = getPathForNewAppName(appPath);
        if (appPath == null) {
          throw new IllegalArgumentException();
        }
      }

      java.util.List<String> command = new ArrayList<String>();
      command.add(javaBin);
      command.add("-jar");
      command.add(FileUtil.getJarFile().getPath());
      command.add("-updateCompleted");

      ProcessBuilder builder = new ProcessBuilder(command);
      builder.start();
      System.exit(0);
    } catch (Exception e) {
      showError("Failed to restart the Control Panel. Please restart manually.");
    }
  }
コード例 #6
0
ファイル: Updater.java プロジェクト: tigerich/yawl
 private String getPathForNewAppName(String appPath) {
   return appPath == null ? null : getPathPart(appPath) + _differ.getNewJarName();
 }
コード例 #7
0
 //
 // -------------------------------------------------------
 //
 @Override
 public void doTask() {
   mDiffer.checkAllSortedLine(this);
 }