title: Java how to delete a file that has the IMMUTABLE bit set
body: <p>Working on a Java 8 project where I copy files from external sources. In one of these sources a file is set with the immutable bit flag.</p>
  
  <p>In <strong>OSX</strong> this is set like so</p>
  
  <pre><code>sudo chflags schg /path/to/file
  </code></pre>
  
  <p>In <strong>Linux</strong></p>
  
  <pre><code>chattr +i /path/to/file
  </code></pre>
  
  <p>I now need to delete the files that I have copied. I had been using Apache Commons IO to delete the directory like so,</p>
  
  <pre><code>FileUtils.deleteDirectory(new File("/path/here"));
  </code></pre>
  
  <p>However this crashes out with a <code>java.io.IOException exception</code>.</p>
  
  <p>Is there any <strong>Cross Platform way</strong> to delete these files? The process running is the owner of the file.</p>