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

kenneth_suter
21.21.2007 7a386afba51234d1528372ed538e75f30fe827a1
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/FileManager.java
@@ -87,6 +87,43 @@
  }
  /**
   * Recursively copies any files or directories appearing in
   * <code>source</code> or a subdirectory of <code>source</code>
   * to the corresponding directory under <code>target</code>.  Files
   * in under <code>source</code> are not copied to <code>target</code>
   * if a file by the same name already exists in <code>target</code>.
   *
   * @param source source directory
   * @param target target directory
   * @throws ApplicationException if there is a problem copying files
   */
  public void synchronize(File source, File target)
          throws ApplicationException
  {
    if (source != null && target != null) {
      String[] sourceFileNames = source.list();
      if (sourceFileNames != null) {
        for (String sourceFileName : sourceFileNames) {
          File sourceFile = new File(source, sourceFileName);
          copyRecursively(sourceFile, target, null, false);
        }
      }
    }
  }
  /**
   * Move a file.
   * @param object File to move
   * @param newParent File representing new parent directory
   * @throws ApplicationException if something goes wrong
   */
  public void move(File object, File newParent)
          throws ApplicationException
  {
    move(object, newParent, null);
  }
  /**
   * Move a file.
   * @param object File to move
   * @param newParent File representing new parent directory
@@ -106,6 +143,17 @@
  /**
   * Deletes a single file or directory.
   * @param object File to delete
   * @throws ApplicationException if something goes wrong
   */
  public void delete(File object)
          throws ApplicationException
  {
    delete(object, null);
  }
  /**
   * Deletes a single file or directory.
   * @param object File to delete
   * @param filter that will be asked whether or not the operation should be
   *        performed
   * @throws ApplicationException if something goes wrong
@@ -364,7 +412,7 @@
              if (destination.exists()) {
                // TODO:  set the file's permissions.  This is made easier in
                // Java 1.6 but until then use the Utils methods
                // Java 1.6 but until then use the TestUtilities methods
                if (Utils.isUnix()) {
                  String permissions =
                          Utils.getFileSystemPermissions(objectFile);