class ShellCommandUtil {

  public static Result copyFile(String srcFile, String destFile, boolean force, boolean sudo) throws IOException, InterruptedException {
    ArrayList<String> command = new ArrayList<>();

    if (WINDOWS) {
      command.add("copy");

      if (force) {
        command.add("/Y"); // force overwrite
      }
    } else {
      command.add("cp");
      command.add("-p"); // preserve mode, ownership, timestamps

      if (force) {
        command.add("-f"); // force overwrite
      }
    }

    command.add(srcFile);
    command.add(destFile);

    return runCommand(command, null, null, sudo);
  }

}