пишет при проверке "Задача не компилируется в сервере" что не так
package com.javarush.task.task18.task1825;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
/*
Собираем файл
*/
public class Solution {
public static void main(String[] args) throws IOException {
List<String>list = new ArrayList<>();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String fileOutput = null;
while (true){
String fileName = reader.readLine();
if (fileName.equals("end")){
break;
}
list.add(fileName);
if (fileOutput == null){
int index = fileName.indexOf(".part");
fileOutput = fileName.substring(0,index);
}
}
FileOutputStream outputStream = new FileOutputStream(String.valueOf(Files.createFile(Path.of(fileOutput))));
Collections.sort(list,new Comparator<String>(){
@Override
public int compare(String o1, String o2) {
int index1 = o1.indexOf(".part");
String s1 = o1.substring(index1+5);
Integer el1 = Integer.parseInt(s1);
int index2 = o2.indexOf(".part");
String s2 = o2.substring(index2+5);
Integer el2 = Integer.parseInt(s2);
return el1 - el2;
}
});
for (String s:list){
FileInputStream inputStream = new FileInputStream(s);
byte[] buf = new byte[200];
while (inputStream.available() > 0){
int count = inputStream.read(buf);
outputStream.write(buf,0,count);
}
inputStream.close();
}
outputStream.close();
}
}