import java.io.File; import java.io.IOException; public class VerzeichnisErstellen { public static void makeDir(String path) { String fileName = "test.txt"; String dirName = "bums"; File file = new File(path + dirName + "/" + fileName); File dir = new File(path + dirName); if (dir.mkdir()) { try { System.out.println("Datei erstellt: " + file.createNewFile()); } catch (IOException e) { e.printStackTrace(); } } else { System.out.println(dir + " konnte nicht erstellt werden"); } } public static void main(String[] args) throws IOException { String path = "/Users/joecze/Desktop/"; makeDir(path); } }