Пишет, что FileInputStream не закрывается : public class Solution { public static void main( String[] args) throws DownloadException, IOException { /* FileInputStream file1 ; */ while (true) { try ( BufferedReader reader = new BufferedReader( new InputStreamReader( System.in)); FileInputStream file1 = new FileInputStream( reader.readLine())) { int size = file1.available(); System.out.println( "size = "+size); if (size < 1000) { reader.close(); file1.close(); throw new DownloadException(); } file1.close(); } } } public static class DownloadException extends Exception { public DownloadException () { System.out.println( "DownloadException"); } } }