Examples of PathNode


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

  }
 
  @GET
  @Path("3/{path:.+}")
  public PathNode getYui3File(@PathParam("path") String path) {
    final PathNode node = fileServer.getNode("3/"+path);
    logger.debug("Serving static {}", node);
    return node;
  }
View Full Code Here

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

public class TestFileServer {

  @Test
  public void testGetResource() throws IOException {
    URL testRoot = getClass().getResource("test-root");
    PathNode pathNode = PathNodeFactory.getPathNode(testRoot);
    FileServer fileServer = new FileServer(pathNode);
    PathNode file = fileServer.getNode("dir/subdir/file.txt");
    Assert.assertEquals(PathNodeFactory.
        getPathNode(getClass().
        getResource("test-root/dir/subdir/file.txt")).getPath(), file.getPath());

  }
View Full Code Here

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

  @Path("{path:.*}")
  @GET
  public PathNode getNode(@PathParam("path") String path) {
    String[] pathSections = path.split("/");
    PathNode current = getRootNode();
    for (String pathSection : pathSections) {
      current = current.getSubPath(pathSection);
      if (!current.exists()) {
        throw new WebApplicationException(404);
      }
    }
    return current;

View Full Code Here

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

    }
    updateFileServer();
  }

  private void registerStaticFiles(Bundle bundle) {
    PathNode pathNode = new BundlePathNode(bundle, "META-INF/static-web");
    bundleNodeMap.put(bundle, pathNode);
  }
View Full Code Here

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

  }

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

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

   *
   * @param context The bundle context of the bundle containing the path.
   * @param path the path where the file are to be exposed
   */
  public void configure(BundleContext context, String path) {
    PathNode pathNode;
    Bundle bundle = context.getBundle();
    URL resourceDir = getClass().getResource(path);
    pathNode = new BundlePathNode(bundle, resourceDir.getPath());
    configure(pathNode);
  }
View Full Code Here

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

    System.setSecurityManager(new SecurityManager());
    felixInstance = new Felix(configProps);
    System.out.println("starting felix");
    felixInstance.start();
    final String revertParam = arguments.getRevertParam();
    final PathNode bundlesRoot = PathNodeFactory.getPathNode(Main.class.getResource("/bundles"));
    final BundleContext bundleContext = felixInstance.getBundleContext();
    installBundlesForStartLevels(bundleContext, bundlesRoot, revertParam);
  }
View Full Code Here

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

    byte startLevel = 0;
    for (String startLevelPath : startLevelePaths) {
      startLevel = Byte.parseByte(
          startLevelPath.substring(startlevelpathprefix.length(),
          startLevelPath.length() - 1));
      final PathNode startLevelPathNode = bundlesRoot.getSubPath(startLevelPath);
      Set<MavenArtifactDesc> artDescs = getArtDescsFrom(startLevelPathNode);
      if (revertParam != null) {
        artDescs = getRevertArtifacts(revertParam, artDescs, installedBundles);
      }
      if (!alreadyInstalled(artDescs, installedBundles) || revertParam != null) {
View Full Code Here

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

  }

  private List<PathNode> getJarPaths(PathNode pathNode) {
    List<PathNode> result = new ArrayList<PathNode>();
    for (String childName : pathNode.list()) {
      PathNode childNode = pathNode.getSubPath(childName);
      if ((!childNode.isDirectory()) && (childName.endsWith(".jar"))) {
        result.add(childNode);
      } else {
        for (PathNode subPath : getJarPaths(childNode)) {
          result.add(subPath);
        }
View Full Code Here

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

   * @param componentContext
   */
  protected void activate(ComponentContext context) {
    Bundle bundle = context.getBundleContext().getBundle();
    URL resourceDir = getClass().getResource("staticweb");
    PathNode pathNode = new BundlePathNode(bundle, resourceDir.getPath());
    logger.debug("Initializing file server for {} ({})", resourceDir,
        resourceDir.getFile());
    fileServer = new FileServer(pathNode);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.