Getting “java.nio.file.AccessDeniedException” when trying to write to a folder
问题 For some reason I keep getting java.nio.file.AccessDeniedException every time I try to write to a folder on my computer using a java webapp on Tomcat. This folder has permissions set to full control for everyone on my computer (Windows). Does anybody know why I get this exception? Here's my code: public void saveDocument(String name, String siteID, byte doc[]) { try { Path path = Paths.get(rootDirectory + siteID); if (Files.exists(path)) { System.out.println("Exists: " + path.toString());