Package org.jboss.virtual.spi

Examples of org.jboss.virtual.spi.VirtualFileHandler


      {
         entryMap = new HashMap<String, VirtualFileHandler>();
         for (VirtualFileHandler child : entryChildren)
            entryMap.put(child.getName(), child);
      }
      VirtualFileHandler child = entryMap.get(name);
      if (child == null && allowNull == false)
         throw new FileNotFoundException(this + " has no child: " + name);
      return child;
   }
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.getChild(root, "");
      assertEquals(root, found);
   }
View Full Code Here

   }

   public void testFindChild() throws Exception
   {
      VFSContext context = getVFSContext("complex");
      VirtualFileHandler root = context.getRoot();
      VirtualFileHandler found = context.getChild(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.getChild(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.getChild(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
      {
         assertNull(context.getChild(root, "doesnotexist"));
      }
      catch (Throwable t)
View Full Code Here

   }

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

   public void testIsArchive() throws Exception
   {
      VFSContext context = getVFSContext("nested");

      VirtualFileHandler root = context.getRoot();
      assertEquals(isArchive(), root.isArchive());

      VirtualFileHandler complex = root.getChild("complex.jar");
      assertNotNull(complex);
      assertEquals(isArchive(), complex.isArchive());

      VirtualFileHandler subfolder = complex.getChild("subfolder");
      assertNotNull(subfolder);
      assertFalse(subfolder.isArchive());

      VirtualFileHandler subchild = subfolder.getChild("subchild");
      assertNotNull(subchild);
      assertFalse(subchild.isArchive());

      VirtualFileHandler subsubfolder = subfolder.getChild("subsubfolder");
      assertNotNull(subsubfolder);
      assertFalse(subsubfolder.isArchive());

      VirtualFileHandler subsubchild = subsubfolder.getChild("subsubchild");
      assertNotNull(subsubchild);
      assertFalse(subsubchild.isArchive());
   }
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.