Не пропускает по тем же пунктам, что не так
Программу тестирую все норм, а валидатор не пропускает
package com.javarush.task.task18.task1825;
import java.io.*;
import java.util.*;
/*
Собираем файл
*/
public class Solution {
// private static final String path = "C:/Users/Админ/Desktop/Lion/Lion.avi.part1.txt";//необходимо было для отладки
public static void main(String[] args) {
BufferedReader readerConsole = new BufferedReader(new InputStreamReader(System.in));
String path = "";
TreeMap<String, byte[]> date = new TreeMap<>();
FileInputStream fileInS = null;
BufferedInputStream bufferedInS = null;
FileOutputStream fileOutS = null;
BufferedOutputStream bufferedOutS = null;
String[] numberPart = null;
List<String> pathsFiles = new ArrayList<>();
String outPath = "";
try{
while (true){
path = readerConsole.readLine();
if(path.equals("end")) break;
pathsFiles.add(path);
}
readerConsole.close();
String[] temp = pathsFiles.get(0).split("\\.");
for (int i = 0; i < temp.length; i++) {
if(!temp[i].contains("part")){
if(i != temp.length-1) outPath = outPath + temp[i]+".";
else outPath = outPath + temp[i];
}
}
System.out.println(outPath);
for (String str: pathsFiles) {
numberPart = str.split("\\.");
String parts = "";
for (int i = 0; i < numberPart.length; i++) {
if(numberPart[i].contains("part")) parts = numberPart[i];
}
System.out.println(parts);
fileInS = new FileInputStream(str);
bufferedInS = new BufferedInputStream(fileInS);
byte[] tempByte = new byte[fileInS.available()];
bufferedInS.read(tempByte);
date.put(parts, tempByte);
fileInS.close();
bufferedInS.close();
}//foreach
fileOutS = new FileOutputStream(outPath, true);
bufferedOutS = new BufferedOutputStream(fileOutS);
for (Map.Entry<String, byte[]> pair: date.entrySet()) {
bufferedOutS.write(pair.getValue());
}
bufferedOutS.flush();
fileOutS.close();
bufferedOutS.close();
}//try
catch(Exception e){
e.printStackTrace();
}//catch
}
}