class EnhDirectory extends Directory {
    protected IOFileFilter editFilter = FileFilterUtils.falseFileFilter(); 
    protected IOFileFilter pageFilter = FileFilterUtils.falseFileFilter(); 
    protected IOFileFilter tailFilter = FileFilterUtils.falseFileFilter();

    public EnhDirectory(Context context, Reference rootLocalReference) {
        super(context, rootLocalReference);
        // TODO Auto-generated constructor stub
    }

    public EnhDirectory(Context context, String rootUri) {
        super(context, rootUri);
        // TODO Auto-generated constructor stub
    }

    @Override
    public void handle(Request request, Response response) {<FILL_FUNCTION_BODY>}

    @Override
    public ServerResource create(Request request, Response response) {
        return new EnhDirectoryResource();
    }

    protected abstract Reference determineRootRef(Request request);

    public boolean allowsEdit(File file) {
        return editFilter.accept(file);
    }

    public void setEditFilter(IOFileFilter fileFilter) {
        editFilter = fileFilter; 
    }

    public boolean allowsPaging(File file) {
        // TODO: limit? 
        return true;
    }

    
}

        synchronized (this) {
            Reference oldRef = getRootRef();
            setRootRef(determineRootRef(request));
            try {
                super.handle(request, response);
            } finally {
                setRootRef(oldRef);
            }

            // XXX: FileRepresentation.isAvailable() returns false for empty files generating status 204 No Content
            // which confuses browsers. Force it back it 200 OK.
            if (response.getStatus() == Status.SUCCESS_NO_CONTENT) {
                response.setStatus(Status.SUCCESS_OK);
            }
        }
    
<no_super_class>