public void filter(FileFilter customFilter) {
        FileFilter filter = makeFilter();

        //Adds custom filter if exists
        if (filter != null && customFilter != null) {
            filter = new AndFilter(filter, customFilter);
        } else if (filter == null && customFilter != null) {
            filter = customFilter;
        }

        //Updates root
        if (filter == null) {
            FileNode node;

            if (root.isDirectory()) {
                node = new FileNode((Directory) root.getUserObject());
            } else {
                node = new FileNode((IndexedFile) root.getUserObject());
            }

            setRoot(node);
        } else {
            FilterNode filterRoot;

            if (root.isDirectory()) {
                filterRoot = new FilterNode((Directory) root.getUserObject(), filter);
            } else {
                filterRoot = new FilterNode((IndexedFile) root.getUserObject(), filter);
            }

            setRoot(filterRoot);
        }
    }