Package org.jboss.virtual

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


     
      VirtualFile root = VFS.getRoot(uri);
      assertEquals(uri, root.toURI());

      VirtualFile found1 = root.findChild("child1");
      assertEquals(child1.toURI(), found1.toURI());

      VirtualFile found11 = root.findChild("child1/child1,1");
      assertEquals(child11.toURI(), found11.toURI());
   }
View Full Code Here


      VirtualFile found1 = root.findChild("child1");
      assertEquals(child1.toURI(), found1.toURI());

      VirtualFile found11 = root.findChild("child1/child1,1");
      assertEquals(child11.toURI(), found11.toURI());
   }

   public void testToURL() throws Exception
   {
      MockVFSContext context = registerStructuredVFSContextWithSubChildren();
View Full Code Here

   public void testStripProtocol() throws Exception
   {
      URL url = getResource("/vfs/test/jar1.jar");
     
      VirtualFile manifest = VFS.getRoot(url).getChild("META-INF/MANIFEST.MF");
      String expected = VFSUtils.stripProtocol(manifest.toURI());
     
      URL manifestURL = new URL("jar:" + url.toExternalForm() + "!/META-INF/MANIFEST.MF");
      System.out.println(manifestURL);
      System.out.println(manifestURL.toURI());
      String actual = VFSUtils.stripProtocol(manifestURL.toURI());
View Full Code Here

   {
      URL rootURL = getResource("/vfs/test");
      VFS vfs = VFS.getVFS(rootURL);

      VirtualFile outerJar = vfs.findChild("unpacked-outer.jar");
      URI outerURI = outerJar.toURI();
      log.debug("outerURI: "+outerURI);
      assertTrue(outerURI+" ends in '/'", outerURI.getPath().endsWith("/"));
      // Validate that jar1 is under unpacked-outer.jar
      URI jar1URI = new URI(outerURI+"jar1.jar/");
      log.debug("jar1URI: "+jar1URI+", path="+jar1URI.getPath());
View Full Code Here

      // Validate that jar1 is under unpacked-outer.jar
      URI jar1URI = new URI(outerURI+"jar1.jar/");
      log.debug("jar1URI: "+jar1URI+", path="+jar1URI.getPath());
      assertTrue("jar1URI path ends in unpacked-outer.jar/jar1.jar!/", jar1URI.getPath().endsWith("unpacked-outer.jar/jar1.jar/"));
      VirtualFile jar1 = outerJar.findChild("jar1.jar");
      assertEquals(jar1URI.getPath(), jar1.toURI().getPath());

      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

   {
      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(expectedURI.getPath(), uri.getPath());

      InputStream is = uri.toURL().openStream();
      is.close();
View Full Code Here

      InputStream is = uri.toURL().openStream();
      is.close();

      tstjar = vfs.findChild("path with spaces/tst%20nospace.jar");
      assertNotNull("tstjar != null", tstjar);
      uri = tstjar.toURI();
      expectedURI = new URI("vfs"+rootURL.toString()+"/path%20with%20spaces/tst%2520nospace.jar/");
      assertEquals(expectedURI.getPath(), uri.getPath());

      is = uri.toURL().openStream();
      is.close();
View Full Code Here

   {
      URL rootURL = getResource("/vfs/test/path with spaces");
      VFS vfs = VFS.getVFS(rootURL);
      VirtualFile tstear = vfs.getChild("spaces.ear");
      assertNotNull("spaces.ear != null", tstear);
      URI uri = tstear.toURI();
      URI expectedURI = new URI("vfs"+rootURL.toString()+"/spaces.ear/");
      assertEquals(expectedURI.getPath(), uri.getPath());
      assertFalse(tstear.isLeaf());

      InputStream is = uri.toURL().openStream();
View Full Code Here

      InputStream is = uri.toURL().openStream();
      is.close();

      VirtualFile tstjar = tstear.getChild("spaces-ejb.jar");
      assertNotNull("spaces-ejb.jar != null", tstjar);
      uri = tstjar.toURI();
      expectedURI = new URI("vfs"+rootURL.toString()+"/spaces.ear/spaces-ejb.jar/");
      assertEquals(expectedURI.getPath(), uri.getPath());
      assertFalse(tstjar.isLeaf());

      is = uri.toURL().openStream();
View Full Code Here

      is = uri.toURL().openStream();
      is.close();

      tstjar = tstear.getChild("spaces-lib.jar");
      assertNotNull("spaces-lib.jar != null", tstjar);
      uri = tstjar.toURI();
      expectedURI = new URI("vfs"+rootURL.toString()+"/spaces.ear/spaces-lib.jar/");
      assertEquals(expectedURI.getPath(), uri.getPath());
      assertFalse(tstjar.isLeaf());

      is = uri.toURL().openStream();
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.