import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;`enter code here`
public class Mover {
public static void main(String[] args) throws IOException, InterruptedException {
URL source = Mover.class.getResource("host");
source.toString();
String destino = "C:\\users\\jerso\\desktop\\";
Path sourceFile = Paths.get(source,"hosts");//here an error occurs.
Path targetFile = Paths.get(destino,"hosts");
Files.copy(sourceFile, targetFile,StandardCopyOption.REPLACE_EXISTING);
enter code here
}
}
I Don't know what to do here->>Path sourceFile = Paths.get(source,"hosts"); The method get(String, String...) in the type Paths is not applicable for the arguments (URL, String.