Code example for UriMatcher

Methods: addURI

0
    private static final int DIR = 1;
    private static final int FILE_NAME = 2;
 
    private static final UriMatcher uriMatcher;
    static { 
        uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
           uriMatcher.addURI(PROVIDER_NAME, "dir", DIR);
           uriMatcher.addURI(PROVIDER_NAME, "file", FILE_NAME);
        } 
 
    public int PruneDir(String sTmpDir) {
        int    nRet = 0;
        int nFiles = 0;
        String sSubDir = null;
 
        File dir = new File(sTmpDir);
 
        if (dir.isDirectory()) {
            File [] files = dir.listFiles();
            if (files != null) {
Contextual code suggestions in your IDE  Get Codota for Java