Don't know where is the problem. First time this occurs...
And the statement / initial code from the website differs from Intellij plugin.
package com.codegym.task.task09.task0929;
import java.io.*;
/*
Let's make the code do something useful!
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String sourceFileName;
try {
sourceFileName = reader.readLine();
} catch (IOException e) {
System.out.println("File does not exist.");
sourceFileName = reader.readLine();
}
String destinationFileName = null;
try {
destinationFileName = reader.readLine();
} catch (IOException e) {
System.out.println("File does not exist.");
destinationFileName = reader.readLine();
}
InputStream fileInputStream = null;
try {
fileInputStream = getInputStream(sourceFileName);
} catch (IOException e) {
System.out.println("File does not exist.");
}
OutputStream fileOutputStream = null;
try {
fileOutputStream = getOutputStream(destinationFileName);
} catch (IOException e) {
System.out.println("File does not exist.");
}
while (fileInputStream.available() > 0) {
int data = 0;
try {
data = fileInputStream.read();
} catch (IOException e) {
System.out.println("File does not exist.");
}
try {
fileOutputStream.write(data);
} catch (IOException e) {
System.out.println("File does not exist.");
}
}
fileInputStream.close();
fileOutputStream.close();
}
public static InputStream getInputStream(String fileName) throws IOException {
return new FileInputStream(fileName);
}
public static OutputStream getOutputStream(String fileName) throws IOException {
return new FileOutputStream(fileName);
}
}