I put the code first and then explain the problem. I can not find what is wrong.
String nuevoNombre = archivo.getParentFile() + "\proc_" + archivo.getName();
File newfileName = new File(nuevoNombre);
return archivoProcesado.renameTo(newfileName);
If I run it from my machine, it works fine. The issue is that when running from a server (it has jre 1.4) renameTo
returns false
, and does not rename the file.
It does not throw any exception, or security or anything. Simply false
and do not rename. Any idea why this can happen and how can I solve it?