title: Java execute command line and always replace when it asks [Y/N]
body: <p>I am calling java.lang.Runtime.exec(...) in my Java program to run a command, say:</p>
  
  <p><code>ffmpeg -i input.mp4 output.mp4</code>.</p>
  
  <p>This is simply passed to my function to run:</p>
  
  <pre><code>    private static void RunCommand(String command) throws InterruptedException {
          try {
              // Execute command
              Process proc = Runtime.getRuntime().exec(command);
  }
  }
  </code></pre>
  
  <p>Everything is OK. But my question is to <strong>handle cases when the file already exists</strong>, so asks if it should replace it: </p>
  
  <pre><code>File 'output.avi' already exists. Overwrite ? [y/N]
  </code></pre>
  
  <p>What is the simplest way to ignore it (always assume <strong>y</strong> and replace)? Maybe through Java in code or FFMPEG command itself?</p>