public static Result delete(String file, boolean force, boolean sudo) throws IOException, InterruptedException {
    List<String> command = new ArrayList<>();

    if (WINDOWS) {
      command.add("del");
      if (force) {
        command.add("/f");
      }
    } else {
      command.add("/bin/rm");
      if (force) {
        command.add("-f");
      }
    }

    command.add(file);

    return runCommand(command, null, null, sudo);
  }
Deletes the <code>file</code>.

@param file the path to the file to be deleted
@param force true to force copy even if the file exists
@param sudo true to execute the command using sudo (ambari-sudo); otherwise false
@return the shell command result
ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java