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

Jean-Noel Rouvignac
18.26.2015 ca669ae54f86dbeea277280690584d9f591c7571
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/FileManager.java
@@ -130,12 +130,11 @@
          throws ApplicationException {
    if (fileToRename != null && target != null) {
      synchronized (target) {
        if (target.exists()) {
          if (!target.delete()) {
            throw new ApplicationException(
                    ReturnCode.FILE_SYSTEM_ACCESS_ERROR,
                    INFO_ERROR_DELETING_FILE.get(Utils.getPath(target)), null);
          }
        if (target.exists() && !target.delete())
        {
          throw new ApplicationException(
                  ReturnCode.FILE_SYSTEM_ACCESS_ERROR,
                  INFO_ERROR_DELETING_FILE.get(Utils.getPath(target)), null);
        }
      }
      if (!fileToRename.renameTo(target)) {
@@ -503,16 +502,11 @@
              while ((i = fis.read(buf)) != -1) {
                fos.write(buf, 0, i);
              }
              if (destination.exists()) {
              if (destination.exists() && isUnix()) {
                // TODO:  set the file's permissions.  This is made easier in
                // Java 1.6 but until then use the TestUtilities methods
                if (isUnix()) {
                  String permissions =
                          Utils.getFileSystemPermissions(objectFile);
                  Utils.setPermissionsUnix(
                          Utils.getPath(destination),
                          permissions);
                }
                String permissions = Utils.getFileSystemPermissions(objectFile);
                Utils.setPermissionsUnix(Utils.getPath(destination), permissions);
              }
              if ((application != null) && application.isVerbose()) {