mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
18.03.2008 1e9ad7aa5cb6ca6b42185faf075a6c12b47aa433
opends/src/quicksetup/org/opends/quicksetup/util/ZipExtractor.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2007 Sun Microsystems, Inc.
 *      Portions Copyright 2007-2008 Sun Microsystems, Inc.
 */
package org.opends.quicksetup.util;
@@ -109,7 +109,6 @@
      zipFile.getName(),
      app);
    if (!zipFile.getName().endsWith(".zip")) {
      // TODO i18n
      throw new IllegalArgumentException("File must have extension .zip");
    }
  }
@@ -158,7 +157,7 @@
   * @param destDir String representing the directory where the zip file will
   * be extracted
   * @param removeFirstPath when true removes each zip entry's initial path
   * when copied to the destination folder.  So for instance if the zip enty's
   * when copied to the destination folder.  So for instance if the zip entry's
   * name was /OpenDS-0.8/some_file the file would appear in the destination
   * directory as 'some_file'.
   * @throws ApplicationException if something goes wrong
@@ -178,7 +177,9 @@
     */
    Map<String, ArrayList<String>> permissions =
        new HashMap<String, ArrayList<String>>();
    ArrayList<String> list = new ArrayList<String>();
    list.add(destDir);
    permissions.put(getProtectedDirectoryPermissionUnix(), list);
    try {
      if(application != null)
         application.checkAbort();
@@ -329,6 +330,15 @@
  }
  /**
   * Returns the UNIX permissions to be applied to a protected directory.
   * @return the UNIX permissions to be applied to a protected directory.
   */
  private String getProtectedDirectoryPermissionUnix()
  {
    return "700";
  }
  /**
   * Returns the file system permissions for a directory.
   * @param path the directory for which we want the file permissions.
   * @return the file system permissions for the directory.