Package org.jboss.virtual

Examples of org.jboss.virtual.VirtualFile.findChild()


      {
         child = child.substring(3);
         vf = vf.getParent();
      }
     
      vf = vf.findChild(child);
      return new VirtualFileAdaptor(vf);
   }

   public URL toURL()
   {
View Full Code Here


      MockVFSContext context = registerSimpleVFSContextWithChildren();

      VirtualFile file = VFS.getRoot(context.getRootURI());
      try
      {
         file.findChild(null);
         fail("Should not be here");
      }
      catch (Throwable t)
      {
         checkThrowable(IllegalArgumentException.class, t);
View Full Code Here

      MockVFSContext context = registerSimpleVFSContextWithChildren();

      VirtualFile file = VFS.getRoot(context.getRootURI());
      try
      {
         file.findChild("doesnotexist");
         fail("Should not be here");
      }
      catch (Throwable t)
      {
         checkThrowable(IOException.class, t);
View Full Code Here

      MockVFSContext context = registerStructuredVFSContextWithSubChildren();

      VirtualFile file = VFS.getRoot(context.getRootURI());
      try
      {
         file.findChild("child1/doesnotexist");
         fail("Should not be here");
      }
      catch (Throwable t)
      {
         checkThrowable(IOException.class, t);
View Full Code Here

      context.getMockRoot().setIOException("findChild");

      VirtualFile file = VFS.getRoot(context.getRootURI());
      try
      {
         file.findChild("child1");
         fail("Should not be here");
      }
      catch (Throwable t)
      {
         checkThrowable(IOException.class, t);
View Full Code Here

   public void testBrokenContext() throws Exception
   {
      VirtualFile file = getVirtualFile("/vfs/sundry", "jar/archive.jar");
      log.debug(file.getName() + " " + file);
      assertFalse("Should not be a leaf", file.isLeaf());
      file = file.findChild("empty");
      log.debug(file.getName() + " " + file);
   }
  
   public void testArchive() throws Exception
   {
View Full Code Here

   public void testArchive() throws Exception
   {
      VirtualFile file = getVirtualFile("/vfs/sundry/", "jar/archive.jar");
      log.debug(file.getName() + " " + file);
      assertFalse("Should not be a leaf", file.isLeaf());
      file = file.findChild("empty");
      log.debug(file.getName() + " " + file);
   }
  
   public void testArchive2() throws Exception
   {
View Full Code Here

      url = JarUtils.createJarURL(url);
      VFS vfs = VFS.getVFS(url);
      VirtualFile file = vfs.getRoot();
      log.debug(file.getName() + " " + file);
      assertFalse("Should not be a leaf", file.isLeaf());
      file = file.findChild("empty");
      log.debug(file.getName() + " " + file);
   }
}
View Full Code Here

            jar1URL.getPath().endsWith("unpacked-outer.jar/jar1.jar"));
      VirtualFile jar1 = outerJar.findChild("jar1.jar");
      assertEquals(jar1URL, jar1.toURL());

      VirtualFile packedJar = vfs.findChild("jar1.jar");
      jar1URL = packedJar.findChild("org/jboss/test/vfs/support").toURL();
      assertTrue("Jar directory entry URLs must end in /: " + jar1URL.toString(), jar1URL.toString().endsWith("/"));
   }

   /**
    * Test that the URI of a VFS corresponding to a directory ends in '/' so that
View Full Code Here

            jar1URI.getPath().endsWith("unpacked-outer.jar/jar1.jar"));
      VirtualFile jar1 = outerJar.findChild("jar1.jar");
      assertEquals(jar1URI, jar1.toURI());

      VirtualFile packedJar = vfs.findChild("jar1.jar");
      jar1URI = packedJar.findChild("org/jboss/test/vfs/support").toURI();
      assertTrue("Jar directory entry URLs must end in /: " + jar1URI.toString(),
            jar1URI.toString().endsWith("/"));
   }

   /**
 
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.