private static void performCopy(@NotNull File _fromFile, @NotNull File _toFile, boolean syncTimestamp) throws IOException {
    if (filesEqual(_fromFile, _toFile)) return;

    Path fromFile = _fromFile.toPath(), toFile = _toFile.toPath();
    try (InputStream in = Files.newInputStream(fromFile); OutputStream out = openOutputStream(toFile)) {
      copy(in, out);
    }
    catch (IOException e) {
      throw new IOException(String.format("Couldn't copy [%s] to [%s]", fromFile, toFile), e);
    }

    if (syncTimestamp) {
      try {
        FileTime timeStamp = Files.getLastModifiedTime(fromFile);
        Files.setLastModifiedTime(toFile, timeStamp);
      }
      catch (IOException e) {
        LOG.warn("Unable to set timestamp of '" + toFile + "'");
      }
    }

    if (SystemInfoRt.isUnix) {
      Set<PosixFilePermission> exec = EnumSet.of(OWNER_EXECUTE, GROUP_EXECUTE, OTHERS_EXECUTE);
      try {
        Set<PosixFilePermission> fromSet = Files.getPosixFilePermissions(fromFile);
        if (ContainerUtil.exists(exec, fromSet::contains)) {
          Set<PosixFilePermission> toSet = Files.getPosixFilePermissions(toFile);
          for (PosixFilePermission permission : exec) {
            if (fromSet.contains(permission)) toSet.add(permission); else toSet.remove(permission);
          }
          Files.setPosixFilePermissions(toFile, toSet);
        }
      }
      catch (IOException e) {
        LOG.warn("Unable to set permissions of '" + toFile + "'");
      }
    }
  }
private static void performCopy(@NotNull File _fromFile, @NotNull File _toFile, boolean syncTimestamp)