Cannot make file java.io.IOException: No such file or directory
I am trying to create a file on the filesystem, but I keep getting this exception: java.io.IOException: No such file or directory I have an existing directory, and I am trying to write a file to that directory. // I have also tried this below, but get same error // new File(System.getProperty("user.home") + "/.foo/bar/" + fileName); File f = new File(System.getProperty("user.home") + "/.foo/bar/", fileName); if (f.exists() && !f.canWrite()) throw new IOException("Kan ikke skrive til filsystemet " + f.getAbsolutePath()); if (!f.isFile()) { f.createNewFile(); // Exception here } else { f