Закрыл же?
package com.javarush.task.task18.task1810;
/*
DownloadException
*/
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
public class Solution {
public static void main(String[] args) throws DownloadException, IOException {
BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
FileInputStream fileread;
while(true){
fileread = new FileInputStream(read.readLine());
if (fileread.getChannel().size() < 1000){
fileread.close();
throw new DownloadException();
}
fileread.close();
}
}
public static class DownloadException extends Exception {
}
}