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:
File uploadedFile = File.createTempFile(prefix, suffix, new File("/opt/ie/var/tmp"));
Is there any way I can set sudo when creating the temp file in Java? Thanks.