public static void delete(String path) throws IOException {
  if (path != null)   delete(Paths.get(path));
}

public static void delete ( String path ) throws IOException { if ( path != null ) delete ( Paths . get ( path ) ) ; }
a method that will delete a file or folder only if it is within the ' target ' directory ( for safety ) . folders are removed recursively .
