Package org.jano.resources

Examples of org.jano.resources.ResourceRef


    return true;
  }

  @Override
  public Response serve(IHTTPSession session, ResourceSystem resourceSystem) throws Exception {
    ResourceRef ref = resourceSystem.get(session.getUri());
    switch (session.getMethod()) {
      case GET: return get(ref);
      case POST: {
        session.parseBody(new HashMap<String, String>());
        return post(ref, session.getParms(), resourceSystem);
View Full Code Here


      //determine
      boolean append = isAppendOp(param);
      String fileName = getFileName(param);

      //obtain resource references for parameter
      ResourceRef ref = resourceSystem.get(Uri.of(dir.uri(), fileName));

      try {
        byte[] content = postParams.get(param).getBytes(charset);
        Resource.put(ref, content, append);
        reply.put(fileName, JsonModel.build(ref));
View Full Code Here

  }

  protected NanoHTTPD.Response serveResource(NanoHTTPD.IHTTPSession session) {
    try {
      String uri = session.getUri();
      ResourceRef ref = resourceSystem.get(uri);

      Diagnostic.log(session.getMethod() + " " + StringUtils.pad(uri, 32) + " " + ref);

      try {
        for (JanoPlugin plugin : plugins) {
View Full Code Here

  }

  @Override
  public NanoHTTPD.Response serve(NanoHTTPD.IHTTPSession session, ResourceSystem resourceSystem) throws Exception {
    String uri = session.getUri();
    ResourceRef ref = resourceSystem.get(uri);

    Locator locator = createLocator(ref.parent());
    String initName = ref.name();

    //parse file into definition
    ZussDefinition definition = new Parser(locator.getResource(initName), locator, initName).parse();

    //translate into CSS
View Full Code Here

  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.ResourceRef

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.