Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/03/2009, 11:33
jlgarcia1977
 
Fecha de Ingreso: octubre-2008
Ubicación: Madrid
Mensajes: 352
Antigüedad: 15 años, 7 meses
Puntos: 5
borrado de ficheros

Tengo el siguiente código para copiar ficheros desde mis jps a mi servidor.

public static boolean grabarFichero(byte[] encKey, String pathFichero) {
boolean salida = false;
try {
File aux = new File(pathFichero);
if (aux.exists())
aux.delete();
FileOutputStream keyfos = new FileOutputStream(pathFichero);
keyfos.write(encKey);
keyfos.close();
salida = true;

} catch (Exception e) {
// System.out.println ("Error al grabar el fichero:"+e.toString());

}
return salida;
}

El copiado se hace perfectamente.

El problema que al borrar no lo borra...

...

File f1 = new File(es.abalia.util.Constantes.RUTACANDIDATOS+nomb reCarpeta+candi.getFichero1());
if (f1.delete()){

...


La ruta esta bien.
No se si me estaré dejando algún método o algo sin cerrar y no puede acceder al file para borrarlo...

¿Alguien ve el problema?