Не проходит по 3м пунктам. Подскажите как сделать проверку, когда пишу C:\qqq\Lion.txt.part1, говорит, что не удается найти указанный файл
package com.javarush.task.task18.task1825;
import java.io.*;
import java.util.*;
/*
Собираем файл
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
FileInputStream file = null;
String s = "";
TreeSet <String> list = new TreeSet<>();
ArrayList <Integer> list2 = new ArrayList<>();
do {
if ((s = br.readLine()).equals("end")) {
break;
}
file = new FileInputStream(s);
list.add(s);
}
while (true);
String path = list.first().replaceAll("\\.part\\d+$", "");
FileOutputStream bw = new FileOutputStream(path);
byte[] b = new byte[file.available()];
int endMarker = 0;
while (file.available() > 0) {
int count = file.read(b);
bw.write(b, endMarker, count);
endMarker += count;
}
bw.close();
file.close();
br.close();
}
}