Package org.wymiwyg.commons.util.dirbrowser

Examples of org.wymiwyg.commons.util.dirbrowser.PathNode


        .getClassLoader().getResources("META-INF/web/application/");
    List<PathNode> nodeList = new ArrayList<PathNode>();
    while (basePathURLEnum.hasMoreElements()) {
      nodeList.add(PathNodeFactory.getPathNode(basePathURLEnum.nextElement()));
    }
    PathNode rootNode = new MultiPathNode(nodeList.toArray(new PathNode[nodeList.size()]));
    prefixHandlerMap.put("/application/", new ApplicationServerHandler(
        rootNode, "/application"));
    prefixHandlerMap.put("/put-infobit", new PutInfoBitHandler(store, identity));
    prefixHandlerMap.put("/meta/sources", new GraphHandlerAdaptor(
        new SourceGraphHandler(store)));
View Full Code Here


    String path = request.getRequestURI().getPath();
    response.addHeader(HeaderName.CACHE_CONTROL, "max-age=300");
    response.addHeader(HeaderName.CACHE_CONTROL, "public");
    path = path.substring(requestURIPrefixLength, path.length());
    StringTokenizer tokens = new StringTokenizer(path, "/");
    PathNode currentBrowseNode = rootNode;
    while (tokens.hasMoreTokens()) {
      String currentToken = tokens.nextToken();
      if (!tokens.hasMoreTokens()) {
        selectBestChild(currentBrowseNode, currentToken,
            request, response);
        return;
      } else {
        currentBrowseNode = currentBrowseNode.getSubPath(currentToken);
      }
    }
    throw new HandlerException(ResponseStatus.NOT_FOUND, "file "+path+" not found");

  }
View Full Code Here

    String fileName = childStrings[0];
    MimeType mimeType = MediaTypesUtil.getDefaultInstance().getTypeForExtension(getExtension(fileName));
    if (mimeType != null) {
      response.addHeader(HeaderName.CONTENT_TYPE, mimeType.toString());
    }
    PathNode resultNode = pathNode.getSubPath(fileName);
    final InputStream dataInputStream;
    try {
      //log.info("getting stream from"+fileName+" in "+pathNode+"("+resultNode+")");
      dataInputStream = resultNode.getInputStream();
    } catch (IOException e) {
      throw new HandlerException(e);
    }
    response.setBody(new MessageBody2Read() {
View Full Code Here

      }

    };
    URL basePathURL = GVSServerLauncher.class
        .getResource("/META-INF/web/application/");
    PathNode rootNode = PathNodeFactory.getPathNode(basePathURL);
    WebServer webServer = webServerFactory.startNewWebServer(
        new ApplicationServerHandler(rootNode, "/application"),
        serverBinding);
    try {
      URL serverURL = new URL("http://"
View Full Code Here

      }

    };
    URL basePathURL = GVSServerLauncher.class
        .getResource("/META-INF/web/application/");
    PathNode rootNode = PathNodeFactory.getPathNode(basePathURL);
    WebServer webServer = webServerFactory.startNewWebServer(
        new ApplicationServerHandler(rootNode, "/application"),
        serverBinding);
    try {
      URL serverURL = new URL("http://"
View Full Code Here

      }

    };
    URL basePathURL = GVSServerLauncher.class
        .getResource("/META-INF/web/application/");
    PathNode rootNode = PathNodeFactory.getPathNode(basePathURL);
    WebServer webServer = webServerFactory.startNewWebServer(
        new ApplicationServerHandler(rootNode, "/application"),
        serverBinding);
    URL serverURL = new URL("http://"
        + serverBinding.getInetAddress().getHostAddress() + ":"
View Full Code Here

  protected void activate(final ComponentContext context) throws IOException,
      URISyntaxException {
    Bundle bundle = context.getBundleContext().getBundle();
    URL resourceDir = getClass().getResource("staticweb");
    PathNode pathNode = new BundlePathNode(bundle, resourceDir.getPath());
    logger.info("Initializing file server for {} ({})", resourceDir,
        resourceDir.getFile());

    fileServer = new FileServer(pathNode);
View Full Code Here

   * @return {@link PathNode}
   */
  @GET
  @Path("{path:.+}")
  public PathNode getStaticFile(@PathParam("path") String path) {
    final PathNode node = fileServer.getNode(path);
    return node;
  }
View Full Code Here

  }

  @GET
  public PathNode getStaticFile(@Context UriInfo uriInfo) {
    TrailingSlash.enforcePresent(uriInfo);
    final PathNode node = getNode("disco.xhtml");
    logger.debug("serving static {}", node);
    return node;
  }
View Full Code Here

      throws IOException, URISyntaxException {
    logger.info("Script Manager activated.");

    Bundle bundle = componentContext.getBundleContext().getBundle();
    URL resourceDir = getClass().getResource("staticweb");
    PathNode pathNode = new BundlePathNode(bundle, resourceDir.getPath());
    logger.info("Initializing file server for {} ({})", resourceDir,
        resourceDir.getFile());

    fileServer = new FileServer(pathNode);
    URL renderlet = getClass().getResource("scriptmanager-script-overview.ssp");
View Full Code Here

TOP

Related Classes of org.wymiwyg.commons.util.dirbrowser.PathNode

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.