title: Why does Files.delete throw a FileSystemException
body: <p>When I run:</p>
  
  <pre><code>Files.delete(Paths.get(filepath));
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>    java.nio.file.FileSystemException: /tmp/some-file: OperationNotPermitted                 
      at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91) ~[?:1.8.0_102]
      at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:1.8.0_102]
      at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:1.8.0_102]
      at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:244) ~[?:1.8.0_102]
      at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) ~[?:1.8.0_102]
      at java.nio.file.Files.delete(Files.java:1126) ~[?:1.8.0_102]                        
     ...
  </code></pre>
  
  <p>The file has permissions:</p>
  
  <pre><code>-rw-rw-rw-   some-user-1 some-group
  </code></pre>
  
  <p>and <code>lsattr</code> shows that it's not immutable:</p>
  
  <pre><code>-------------e-
  </code></pre>
  
  <p>The Java code is turned into script that does some stuff and ultimately runs <code>java</code> on SpringLauncher:</p>
  
  <pre><code>sudo -u some-user-2 the-script
  </code></pre>
  
  <p><code>some-user-2</code> is not in some-group, but the file has user write permissions and <code>/tmp/</code> has 777 permissions, so why am I not able to delete it in Java?</p>
  
  <p>When I change the user (<code>chown /tmp/some-file some-user-2</code>), I am able to delete it with the above Java code.  This also confuses me.</p>