What I'm trying to do is copy the image inside the directory directory but when I execute the method, nothing happens but the directory becomes an arhivo that I have to do to make it work for me.
public static void copyFile(String origen, String destino) throws IOException {
Path FROM = Paths.get(origen);//img/imagen1.jpg
Path TO = Paths.get(destino);//img/directorio
System.out.println("from: "+ FROM);
System.err.println("TO: "+ TO);
// sobreescribir el fichero de destino, si existe, y copiar
// los atributos, incluyendo los permisos rwx
CopyOption[] options = new CopyOption[]{
StandardCopyOption.REPLACE_EXISTING,
StandardCopyOption.COPY_ATTRIBUTES
};
Files.copy(FROM, TO, options);
}