Package org.jboss.virtual

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


      VirtualFile o3 = o2.getChild("level3.zip");
      VirtualFile l3 = l2.getChild("level3.zip");
      assertFalse(l3.isLeaf());
      assertEquals(o3.toURL(), l3.toURL());
      assertEquals(getProtocol() + urlString + "level1.zip/level2.zip/level3.zip/", l3.toURL().toExternalForm());

      VirtualFile o3sub = o3.getChild("test3.txt");
      VirtualFile l3sub = l3.getChild("test3.txt");
      assertTrue(l3sub.isLeaf());
      assertEquals(o3sub.toURL(), l3sub.toURL());
View Full Code Here


      assertEquals(getProtocol() + urlString + "level1.zip/level2.zip/level3.zip/", l3.toURL().toExternalForm());

      VirtualFile o3sub = o3.getChild("test3.txt");
      VirtualFile l3sub = l3.getChild("test3.txt");
      assertTrue(l3sub.isLeaf());
      assertEquals(o3sub.toURL(), l3sub.toURL());
      assertEquals(getProtocol() + urlString + "level1.zip/level2.zip/level3.zip/test3.txt", l3sub.toURL().toExternalForm());

      ear.cleanup();
   }
View Full Code Here

      VirtualFile o3sub = o3.getChild("test3.txt");
      VirtualFile l3sub = l3.getChild("test3.txt");
      assertTrue(l3sub.isLeaf());
      assertEquals(o3sub.toURL(), l3sub.toURL());
      assertEquals(getProtocol() + urlString + "level1.zip/level2.zip/level3.zip/test3.txt", l3sub.toURL().toExternalForm());

      ear.cleanup();
   }

   protected String getProtocol()
View Full Code Here

    * @throws Exception for any error
    */
   public void testContent() throws Exception
   {
      VirtualFile file = getFile();
      URL url = file.toURL();
      URLConnection conn = url.openConnection();
      assertEquals(file, conn.getContent());
   }

   /**
 
View Full Code Here

    * @throws Exception for any error
    */
   public void testContentLenght() throws Exception
   {
      VirtualFile file = getFile();
      URL url = file.toURL();
      URLConnection conn = url.openConnection();
      assertEquals(file.getSize(), conn.getContentLength());
   }

   /**
 
View Full Code Here

    * @throws Exception for any error
    */
   public void testLastModified() throws Exception
   {
      VirtualFile file = getFile();
      URL url = file.toURL();
      URLConnection conn = url.openConnection();
      assertEquals(file.getLastModified(), conn.getLastModified());
   }

   /**
 
View Full Code Here

    * @throws Exception for any error
    */
   public void testInputStream() throws Exception
   {
      VirtualFile file = getFile();
      URL url = file.toURL();
      URLConnection conn = url.openConnection();
      assertTrue(Arrays.equals(readBytes(file.openStream()), readBytes(conn.getInputStream())));
   }

   protected static byte[] readBytes(InputStream inputStream) throws Exception
View Full Code Here

      VirtualFile manifest = VFS.getRoot(manifestURL);
     
      InputStream in = manifest.openStream();
      in.close();
     
      in = manifest.toURL().openStream();
      in.close();
   }
}
View Full Code Here

            configureCache(cache);

            VirtualFile root = VFS.getRoot(url);

            VirtualFile file = root.findChild("/nested.jar/META-INF/empty.txt");
            URL fileURL = file.toURL();
            VirtualFile nested = root.findChild("/nested.jar/complex.jar/subfolder/subsubfolder/subsubchild");
            URL nestedURL = nested.toURL();

            assertEquals(file, VFS.getRoot(fileURL));
            assertEquals(nested, VFS.getRoot(nestedURL));
View Full Code Here

            VirtualFile root = VFS.getRoot(url);

            VirtualFile file = root.findChild("/nested.jar/META-INF/empty.txt");
            URL fileURL = file.toURL();
            VirtualFile nested = root.findChild("/nested.jar/complex.jar/subfolder/subsubfolder/subsubchild");
            URL nestedURL = nested.toURL();

            assertEquals(file, VFS.getRoot(fileURL));
            assertEquals(nested, VFS.getRoot(nestedURL));

            VFSCacheFactory.setInstance(null);
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.