Look at what you appear to be doing:
String phoneNumber = "";
String textMessage = "";
FileInputStream excelFile = new FileInputStream(file);
Path sourcePath = Paths.get(String.valueOf(file));
Path targetPath = Paths.get("C:\\Users\\anar.memmedov\\Desktop\\ko\\" + sourcePath.getFileName());
Files.move(sourcePath, targetPath);
One of the first things you do is open a file, apparently to read it. Then you try to move that file to a different folder. You cannot do that. If you open a file, you have to close it before you can move it.