Ребят, не понимаю, что кидается на тест, что он фейлиться (
package com.javarush.task.task18.task1827;
/*
Прайсы
*/
import java.io.*;
import java.util.Scanner;
public class Solution
{
public static void main(String[] args) throws IOException
{
Scanner in = new Scanner(System.in);
String fileName = in.nextLine();
in.close();
try
{
if (args[0].equals("-c"))
{
FileInputStream input = new FileInputStream(fileName);
byte [] allBytes = new byte[input.available()];
input.read(allBytes);
String tmp = new String (allBytes);
String [] text = tmp.split("\n");
String [] numbers =text[text.length - 1].split("\\D");
input.close();
BufferedWriter writer = new BufferedWriter(new FileWriter(new File(fileName), true));
writer.write(String.format("%-8d%-30.30s%-8s%-4s", Integer.parseInt(numbers[0])+1, args[1], args[2],args[3]));
writer.close();
}
}
catch (Exception ignored)
{
}
}
}