Господа,
Валидатор не жалует код ...
Проверял на кошечках файлах...все ок!
В чем может быть причина ?
package com.javarush.task.pro.task15.task1517;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Scanner;
import static java.nio.file.StandardCopyOption.ATOMIC_MOVE;
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
/*
Файловые операции
*/
public class Solution {
public static void main(String[] args) throws IOException {
/* try {*/
Scanner scanner = new Scanner(System.in);
Path filePath = Path.of(scanner.nextLine());
Path fileNewPath = Path.of(scanner.nextLine());
if (Files.notExists(filePath) && Files.notExists(fileNewPath)) {
Files.createFile(filePath);
Files.move(filePath, fileNewPath);
// System.out.println("Run 1 block");
}
else if (Files.exists(filePath) && Files.exists(fileNewPath)){
Files.delete(filePath);
// System.out.println("Run 2 block");
}
else if (Files.exists(filePath) && Files.notExists(fileNewPath)){
Files.move(filePath, fileNewPath);
// System.out.println("Run 3 block");
}
/* } catch (IOException e) {
e.printStackTrace();
}*/
}
}