final ParsedArguments cmdLine = HELP_INFO.parse(args); final File file = ARG_TOUCH.getFile(cmdLine); final File parentFile = file.getParentFile();  if (!file.exists()) { if (parentFile!=null && !parentFile.exists()) { if (!parentFile.mkdirs()) { System.err.println("Parent dirs can't create"); } } if (file.createNewFile()) { System.out.println("File created"); } else { System.err.println("File can't create"); } } else { System.out.println("File already exist"); }
new TouchCommand().execute(new CommandLine(args), System.in, System.out, System.err);
    public static void main(String[] args) throws Exception {        final ParsedArguments cmdLine = HELP_INFO.parse(args);        final File file = ARG_TOUCH.getFile(cmdLine);        final File parentFile = file.getParentFile();        if (!file.exists()) {            if (parentFile!=null && !parentFile.exists()) {                if (!parentFile.mkdirs()) {                    System.err.println("Parent dirs can't create");                }            }            if (file.createNewFile()) {                System.out.println("File created");            } else {                System.err.println("File can't create");            }        } else {            System.out.println("File already exist");        }    }