code: private static void filter(String filename, String filtername) throws Exception
     {
        ProjectFile project = new UniversalProjectReader().read(filename);
        Filter filter = project.getFilters().getFilterByName(filtername);
  
        if (filter == null)
        {
           displayAvailableFilters(project);
        }
        else
        {
           System.out.println(filter);
           System.out.println();
  
           if (filter.isTaskFilter())
           {
              processTaskFilter(project, filter);
           }
           else
           {
              processResourceFilter(project, filter);
           }
        }
     }
docs: This method opens the named project, applies the named filter
  and displays the filtered list of tasks or resources. If an
  invalid filter name is supplied, a list of valid filter names
  is shown.
  
  @param filename input file name
  @param filtername input filter name