failing validation
package com.codegym.task.task13.task1319;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.*;
/*
Writing to a file from the console
*/
public class Solution {
public static void main(String[] args) {
// write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = null;
try {
String name = reader.readLine();
FileWriter writer = new FileWriter(name);
bw = new BufferedWriter(writer);
String line = "";
while(true){
line = reader.readLine();
if (line.equals("exit")){
break;
}
bw.write(line);
}
bw.write(line);
bw.close();
}catch (Exception e){
}
}
}