Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/03/2012, 07:32
Avatar de Fuzzylog
Fuzzylog
 
Fecha de Ingreso: agosto-2008
Ubicación: En internet
Mensajes: 2.511
Antigüedad: 15 años, 8 meses
Puntos: 188
Respuesta: moveTo y delete

Pues has de revisar eso porque en un servlet debería funcionar perfectamente. Igual no está pillando el archivo a partir de la ruta correcta...

File fichero = new File("rutaRelativaDeTuArchivo"); // Archivo a renombrar
File ficheroRenombrado = new File("rutaRelativaDeTuArchivoRenombrado");
boolean renombrado = fichero.renameTo(ficheroRenombrado);
if (renombrado) {
system.out.println("El fichero se ha renombrado");
} else {
system.out.println("El fichero no se ha renombrado");
}
__________________
if (fuzzy && smooth) {
fuzzylog = "c00l";
return true;
}