java.io.IOException: Access is deniedCause:
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(File.java:1345)
at java.io.File.createTempFile(File.java:1434)
When you try to create a tmp file in java for exclusive use in Windows operating system
Solution:
There are a number of reasons you could get this error.
- You have a multi-threaded program and two threads are trying to create the same file. This is a logical error, the solution is to recheck your logic (put a mutex!)
- You don't have access to the path. Read only?
- If neither of the above checks out, then check if the file you are trying to create already exists. If it does, delete it and try again. This worked for me
0 comments:
Post a Comment