File file = new File("Versteckter Ordner");
Path path = file.toPath();
if (file.mkdir()){
System.out.println("Ordner erstellt");
}
try {
Files.setAttribute(path, "dos:hidden", true);
System.out.println("Ordner ist versteckt!");
} catch (IOException e) {e.printStackTrace();}