i have a problem with file cration in java. i found this question Java IO: file is not generated
but that did not provide an answer.
My tomcat webapp can create a file xml on remote folder(\myserver\myfolder) when is running on my dev enviroment. when i publish it on the test and rpod enviroment, my app does not create anything at all and those two machines are in the same network where my local enviroment is and they have also the same grants. It also does not throws any exception!!!
here's my code:
try{
Util.useNet(true, "\\\\myserver\\myfolder\\");
fos = new FileOutputStream("\\\\myserver\\myfolder\\")+ fileName);
fos.write("<?xml version=\"1.0\"?>".getBytes("UTF-8"));
byte[] bytes = xml.getBytes("UTF-8");
fos.write(bytes);
fos.flush();
}catch (Exception e){
Log.setErrorLog("errore", e);
}
finally{
try{
fos.close();
}catch (Exception e) {
}
}
the method "useNet" also call the command "net use" (just to be sure).