I have an application made in Java, where I move files from one directory to another and organize them, the problem is that they are moved but not copied, another serious doubt, that if this file is copied, the attributes of the file, for example, the creation date?
What I need to know is how I can copy them instead of moving them, this is the part of the method where I move them using the renameTo
.
//Si se realizo con exito el movimiento de archivos
if(bool){
bool = false;
resultNuFolder = NuCarpetaCnFicha(newPath, noFicha);
bool = finalArchivo.renameTo(new File(resultNuFolder, oldName));
if(bool)
bool=true;
} else {
System.out.println("El archivo "+ oldName + " no pudo ser cambiado de destino");
}