package com.javarush.task.task18.task1810; import java.io.*; public class Solution { public static void main(String[] args) throws DownloadException, IOException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); FileInputStream fileInputStream; do { fileInputStream = new FileInputStream(bufferedReader.readLine()); } while (fileInputStream.getChannel().size() > 1000); fileInputStream.close(); throw new DownloadException(); } public static class DownloadException extends Exception { } }