I want to create a file in the project directory so i tried this code and i created a temp directory on the project directory
try {
File file = new File("temp/"+soCourrier.getHeaders().get("filename").get(0));
FileOutputStream fos = new FileOutputStream(file);
fos.write(sCourrier.getBody());
model.addAttribute("path", file.getAbsoluteFile());
} catch (IOException e) {
e.printStackTrace();
}
But this gives me an error
java.io.IOException: Le chemin d’accès spécifié est introuvable
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(Unknown Source)
at controllers.UserController.showCourrierDetail(UserController.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
can any one help me ?