Package org.jboss.virtual

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


   public void testInnerManifestClasspath()
      throws Exception
   {
      URL rootURL = getResource("/vfs/test");
      VFS vfs = VFS.getVFS(rootURL);
      VirtualFile outerjar = vfs.findChild("withalong/rootprefix/outermf.jar");
      VirtualFile conatinerjar = outerjar.findChild("inner-container.jar");
      VirtualFile innerjar = conatinerjar.findChild("innermf.jar");
      assertNotNull("innermf.jar != null", innerjar);
  
      ArrayList<VirtualFile> cp = new ArrayList<VirtualFile>();
View Full Code Here


   public void testJarWithSpacesInPath()
      throws Exception
   {
      URL rootURL = getResource("/vfs/test");
      VFS vfs = VFS.getVFS(rootURL);
      VirtualFile tstjar = vfs.findChild("path with spaces/tst.jar");
      assertNotNull("tstjar != null", tstjar);
      URI uri = tstjar.toURI();
      URI expectedURI = new URI("vfs"+rootURL.toString()+"/path%20with%20spaces/tst.jar");
      assertEquals(uri, expectedURI);
   }
View Full Code Here

   public void testUnpackedJarWithSpacesInPath()
      throws Exception
   {
      URL rootURL = getResource("/vfs/test");
      VFS vfs = VFS.getVFS(rootURL);
      VirtualFile tstjar = vfs.findChild("path with spaces/unpacked-tst.jar");
      assertNotNull("tstjar != null", tstjar);
      URI uri = tstjar.toURI();
      URI expectedURI = new URI("vfs" + rootURL.toString()+"/path%20with%20spaces/unpacked-tst.jar/");
      assertEquals(uri, expectedURI);
   }
View Full Code Here

   private void testGetMetaDataFromJar(String name) throws Exception
   {
      URL rootURL = getResource("/vfs/test");
      VFS vfs = VFS.getVFS(rootURL);
     
      VirtualFile jar = vfs.findChild(name);
      assertNotNull(jar);
      VirtualFile metadataLocation = jar.findChild("META-INF");
      assertNotNull(metadataLocation);

      VirtualFile metadataByName = metadataLocation.findChild("some-data.xml");
View Full Code Here

         {
            vfs = VFS.getVFS(vfsurl);
            urlCache.put(vfsurl, vfs);
         }
      }
      return vfs.findChild(relativePath);

   }

   public static VirtualFile resolveVirtualFile(URL vfsurl, String relativePath) throws IOException
   {
View Full Code Here

   }

   public static VirtualFile resolveVirtualFile(URL vfsurl, String relativePath) throws IOException
   {
      VFS vfs = VFS.getVFS(vfsurl);
      return vfs.findChild(relativePath);
   }

   public synchronized VirtualFile getVirtualFile() throws IOException
   {
      if (file == null)
View Full Code Here

      MockVFSContext context = registerSimpleVFSContextWithChildren();

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

      MockVFSContext context = registerSimpleVFSContextWithChildren();

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

      MockVFSContext context = registerStructuredVFSContextWithSubChildren();

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

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

      try
      {
         VFS vfs = VFS.getVFS(context.getRootURI());
         vfs.findChild("child1");
         fail("Should not be here");
      }
      catch (Throwable t)
      {
         checkThrowable(IOException.class, t);
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.