private String getListenerRootPath(Path root) {
        String listener = "";

        for (String s : mFilelistenerToPaths.values()) {
            if (root.toString().contains(s)) {
                listener = s;
            }
        }

        return listener;
    }
private String getListenerRootPath ( Path root ) { String listener = "" ; for ( String s : mFilelistenerToPaths . values ( ) ) { if ( root . toString ( ) . contains ( s ) ) { listener = s ; } } return listener ; }
This utility method allows you to get the root path for a subdirectory.

The root path is a directory that has been explicitly listened to and not
just recursively.

@param root
@return returns the root path as a String