예제 #1
0
 /**
  * Iterates over the contents of the pluginJarFile to find the sauce-connect-3.0.jar file.
  *
  * @param jarFileEntry
  * @param updatedSauceConnectJarFile
  * @throws java.io.IOException
  */
 private void search(TFile jarFileEntry, TFile updatedSauceConnectJarFile) throws IOException {
   if (jarFileEntry.getName().endsWith("sauce-connect-3.0.jar")) {
     update(jarFileEntry, updatedSauceConnectJarFile);
   } else if (jarFileEntry.isDirectory()) {
     for (TFile member : jarFileEntry.listFiles()) search(member, updatedSauceConnectJarFile);
   }
 }
예제 #2
0
  /**
   * Adds the updatedSauceConnectJarFile to the pluginJarFile.
   *
   * @param pluginJarFile
   * @param updatedSauceConnectJarFile
   * @throws java.io.IOException
   */
  public void addFileToJar(File pluginJarFile, TFile updatedSauceConnectJarFile)
      throws IOException {

    TFile.setDefaultArchiveDetector(new TArchiveDetector("jar"));
    search(new TFile(pluginJarFile), updatedSauceConnectJarFile);
    TFile.umount();
  }