final ParsedArguments cmdLine = HELP_INFO.parse(args); final File entry = ARG_DIR.getFile(cmdLine); boolean deleteOk=false;  if (!entry.exists()) { System.err.println(entry + " does not exist"); }  if(entry.isDirectory()){ final File[] subFile=entry.listFiles(); for(int i=0;i<subFile.length;i++){ final String name=subFile[i].getName(); if(!name.equals(".") && !name.equals("..")){ System.err.println("Directory is not empty"); return; } } }  deleteOk=entry.delete();  if(!deleteOk){ System.err.println(entry + " does not deleted"); }
new DeleteCommand().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 entry = ARG_DIR.getFile(cmdLine);	    boolean deleteOk=false;				if (!entry.exists()) {			System.err.println(entry + " does not exist");		}		// for this time, delete only empty directory (wait implementation of -r option)		if(entry.isDirectory()){			final File[] subFile=entry.listFiles();			for(int i=0;i<subFile.length;i++){ 					final String name=subFile[i].getName();					if(!name.equals(".") && !name.equals("..")){						System.err.println("Directory is not empty");						return;					}							}		}			deleteOk=entry.delete();			if(!deleteOk){			System.err.println(entry + " does not deleted");		}			}