Package org.jano.resources

Examples of org.jano.resources.ResourceView


   */
  @Override
  public ResourceRef get(String resourceUri) {
    String uri = resourceUri;
    while (!uri.isEmpty()) {
      ResourceView view = mountPoints.get(uri);
      if (null != view) {
        return view.viewOf(uri, resourceUri.substring(uri.length()), this);
      }
      //just take another part
      int nextSeparator = uri.lastIndexOf(Uri.PATH_SEPARATOR_CHAR);
      uri = uri.substring(0, nextSeparator);
    }

    ResourceView view = mountPoints.get(Uri.ROOT);
    if (null != view) {
      return view.viewOf(Uri.ROOT, resourceUri, this);
    }

    throw new ResourceException("Resource URI '" + resourceUri + "' has no known views");
  }
View Full Code Here


   * @param rights set of the rights allowed to execute under rights
   * @return
   */
  public static ResourceView secure(final ResourceView resourceView, final Set<Right> rights) {
    final SecurityContext context = createContext(rights);
    return new ResourceView() {
      @Override
      public ResourceRef viewOf(String viewUri, String childUri, ResourceSystem system) {
        ResourceRef ref = resourceView.viewOf(viewUri, childUri, system);
        return new SecuredRef(ref, context);
      }
View Full Code Here

TOP

Related Classes of org.jano.resources.ResourceView

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.