Well, I'm having problems with this one. Maybe some help? Thanks guys
package com.codegym.task.task18.task1824;
/*
Files and exceptions
*/
import java.io.*;
import java.util.ArrayList;
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String filename;
FileInputStream stream = null;
ArrayList<FileInputStream> list = new ArrayList<>();
while (true) {
filename = reader.readLine();
try {
stream = new FileInputStream(filename);
list.add(stream);
} catch (FileNotFoundException e) {
System.out.println(filename);
return;
} finally {
reader.close();
if (stream != null) {
stream.close();
}
}
}
}
}