N1 Grid Service Provisioning System 5.0 Plug-in Development Guide

Sample Code for Browsing Function


Example 3–1 Browser Filter

The following example filters all files of the name *.tmp:

public class TmpFilter implements BrowserFilter, ExampleFilter {

    public String getName() {
        return "tmpFilter";
    }
    public String getDescription() {
        return "show only *.tmp files";
    }
    public boolean filter(ExampleBrowserNode node) {
        return node.getLocalName().endsWith(".tmp");
    }

}