Example usage for org.apache.cassandra.auth IResource hasParent

List of usage examples for org.apache.cassandra.auth IResource hasParent

Introduction

In this page you can find the example usage for org.apache.cassandra.auth IResource hasParent.

Prototype

boolean hasParent();

Source Link

Document

Indicates whether or not this resource has a parent in the hierarchy.

Usage

From source file:org.wso2.carbon.cassandra.server.CarbonCassandraAuthorizer.java

License:Apache License

private String getResourcePath(IResource resource) {
    String resourcePath = resource.getName();
    IResource parent = null;//  ww  w  .  j  a v a  2 s .  co m
    while (true) {
        if (resource.hasParent()) {
            parent = resource.getParent();
            resourcePath = parent.getName().concat(File.separator).concat(resourcePath);
            resource = parent;
        } else { //ROOT level
            break;
        }
    }
    return resourcePath;
}