applyFiltersAllItems(c);
if (identifier == null) { applyFiltersAllItems(c); } else { DSpaceObject dso = HandleManager.resolveToObject(c, identifier); if (dso == null) { throw new IllegalArgumentException("Cannot resolve " + identifier + " to a DSpace object"); }  switch (dso.getType()) { case Constants.COMMUNITY: applyFiltersCommunity(c, (Community)dso); break; case Constants.COLLECTION: applyFiltersCollection(c, (Collection)dso); break; case Constants.ITEM: applyFiltersItem(c, (Item)dso); break; } }
    public static void main(String[] argv) throws Exception    {        // set headless for non-gui workstations        System.setProperty("java.awt.headless", "true");        // create an options object and populate it        CommandLineParser parser = new PosixParser();        Options options = new Options();        options.addOption("v", "verbose", false,                "print all extracted text and other details to STDOUT");        options.addOption("f", "force", false,                "force all bitstreams to be processed");        options.addOption("n", "noindex", false,                "do NOT re-create search index after filtering bitstreams");        options.addOption("h", "help", false, "help");        CommandLine line = parser.parse(options, argv);        if (line.hasOption('h'))        {            HelpFormatter myhelp = new HelpFormatter();            myhelp.printHelp("MediaFilter\n", options);            System.exit(0);        }        if (line.hasOption('v'))        {            isVerbose = true;        }        if (line.hasOption('n'))        {            createIndex = false;        }        if (line.hasOption('f'))        {            isForce = true;        }        Context c = null;        try        {            c = new Context();            // have to be super-user to do the filtering            c.setIgnoreAuthorization(true);            // now apply the filters            applyFiltersAllItems(c);            // create search index?            if (createIndex)            {                System.out.println("Creating search index:");                DSIndexer.createIndex(c);            }            c.complete();            c = null;        }        finally        {            if (c != null)            {                c.abort();            }        }    }