title: java.io.IOException: Permission denied cannot create file in Linux
body: <p>I am trying to create a temporary file under /opt/ie/var/tmp in linux, the permission for /opt/ie/var/tmp is drwxr-xr-x. I got java.io.IOException: Permission denied cannot create file when creating, below is my code:</p>
  <pre><code>File uploadedFile = File.createTempFile(prefix, suffix, new File(&quot;/opt/ie/var/tmp&quot;));
  </code></pre>
  <p>Is there any way I can set sudo when creating the temp file in Java? Thanks.</p>