I create new file in new directory:
File logFile = new File("C:/test/test/test.txt");
logFile.getParentFile().mkdirs();
logFile.createNewFile();
And if I agin try create new file (whithout filename extension, only "test" file):
File logFile = new File("C:/test/test");
logFile.getParentFile().mkdirs();
logFile.createNewFile();
I get:
FileNotFoundException (Access is denied)