public class Solution {
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
public static void main(String[] args) throws DownloadException {
while (true) {
try (FileInputStream fis = new FileInputStream(readFileName())) {
if (fis.available() < 1000) {
br.close();
throw new DownloadException();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
private static String readFileName() {
String fileName = "";
try {
fileName = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return fileName;
}
public static class DownloadException extends Exception {
}
}
package com.javarush.task.task18.task1810;
/*
DownloadException
*/
import java.io.*;
public class Solution {
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
public static void main(String[] args) throws DownloadException {
while (true) {
try (FileInputStream fis = new FileInputStream(readFileName())) {
if (fis.available() < 1000) {
br.close();
throw new DownloadException();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
private static String readFileName() {
String fileName = "";
try {
fileName = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return fileName;
}
public static class DownloadException extends Exception {
}
}
/*
c:/data.txt
c:/data2.txt
c:/data3.txt
*/