Package org.jboss.virtual.spi

Examples of org.jboss.virtual.spi.VirtualFileHandler


   * @throws URISyntaxException
   */
  public IndexMetadataFactory(URL url) throws IOException, URISyntaxException {
    VFS.init();
    ZipEntryContext context = new ZipEntryContext(url);
    VirtualFileHandler vfh = context.getRoot();
    VirtualFile vdb = new VirtualFile(vfh);
    List<VirtualFile> children = vdb.getChildrenRecursively(new VirtualFileFilter() {
      @Override
      public boolean accepts(VirtualFile file) {
        return file.getName().endsWith(IndexConstants.NAME_DELIM_CHAR+IndexConstants.INDEX_EXT);
View Full Code Here


  
   public void testGetRoot() throws Exception
   {
      VFSContext context = getVFSContext("simple");
      URI rootURI = context.getRootURI();
      VirtualFileHandler rootHandler = context.getRoot();
      VFS vfs = context.getVFS();
      VirtualFile rootFile = vfs.getRoot();
     
      assertEquals(rootURI, rootHandler.toURI());
      assertEquals(rootHandler.getVirtualFile(), rootFile);
   }
View Full Code Here

   */
  
   public void testGetChildren() throws Exception
   {
      VFSContext context = getVFSContext("children");
      VirtualFileHandler root = context.getRoot();
      List<VirtualFileHandler> children = context.getChildren(root, false);
     
      Set<String> expected = new HashSet<String>();
      expected.add("child1");
      expected.add("child2");
View Full Code Here

   }

   public void testFindChildRoot() throws Exception
   {
      VFSContext context = getVFSContext("complex");
      VirtualFileHandler root = context.getRoot();
      VirtualFileHandler found = context.findChild(root, "");
      assertEquals(root, found);
   }
View Full Code Here

   }

   public void testFindChild() throws Exception
   {
      VFSContext context = getVFSContext("complex");
      VirtualFileHandler root = context.getRoot();
      VirtualFileHandler found = context.findChild(root, "child");
      assertEquals("child", found.getPathName());
   }
View Full Code Here

   }

   public void testFindChildSubFolder() throws Exception
   {
      VFSContext context = getVFSContext("complex");
      VirtualFileHandler root = context.getRoot();
      VirtualFileHandler found = context.findChild(root, "subfolder");
      assertEquals("subfolder", found.getPathName());
   }
View Full Code Here

   }

   public void testFindChildSubChild() throws Exception
   {
      VFSContext context = getVFSContext("complex");
      VirtualFileHandler root = context.getRoot();
      VirtualFileHandler found = context.findChild(root, "subfolder/subchild");
      assertEquals("subfolder/subchild", found.getPathName());
   }
View Full Code Here

   }

   public void testFindChildDoesNotExist() throws Exception
   {
      VFSContext context = getVFSContext("complex");
      VirtualFileHandler root = context.getRoot();
      try
      {
         context.findChild(root, "doesnotexist");
         fail("Should not be here!");
      }
View Full Code Here

   }

   public void testFindChildNullPath() throws Exception
   {
      VFSContext context = getVFSContext("complex");
      VirtualFileHandler root = context.getRoot();
      try
      {
         context.findChild(root, null);
         fail("Should not be here!");
      }
View Full Code Here

   }

   public void testVisit() throws Exception
   {
      VFSContext context = getVFSContext("children");
      VirtualFileHandler root = context.getRoot();
      MockVirtualFileHandlerVisitor visitor = new MockVirtualFileHandlerVisitor();
      context.visit(root, visitor);
     
      Set<String> expected = new HashSet<String>();
      expected.add("child1");
View Full Code Here

TOP

Related Classes of org.jboss.virtual.spi.VirtualFileHandler

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.