Package org.jboss.virtual

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


         VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit;
         try
         {
            VirtualFile classes = vfsUnit.getFile("WEB-INF/classes");
            // Tomcat can't handle the vfs urls yet
            URL vfsURL = classes.toURL();
            String vfsurl = vfsURL.toString();
            if (vfsurl.startsWith("vfs"))
               vfsURL = new URL(vfsurl.substring(3));
            classpath = new ArrayList<URL>();
            classpath.add(vfsURL);
View Full Code Here


      pi.setExcludeUnlistedClasses(metaData.isExcludeUnlistedClasses());
      VirtualFile root = di.getRootFile();
      log.debug("Persistence root: " + root);
      // TODO - update this with VFSUtils helper method
      // hack the JPA url
      URL url = root.toURL();
      // is not nested, so direct VFS URL is not an option
      if (VFSUtils.isNestedFile(root) == false)
      {
         String urlString = url.toExternalForm();
         if (urlString.startsWith("vfs"))
View Full Code Here

            // assertEquals(vfs, root.getVFS()); // this is actually the real cause
            VirtualFile file = root.getChild(testPath);
            assertNotNull(file);
            assertTrue(file.getSize() > 0);
            assertCopies(store);
            URL url = file.toURL();
            URLConnection conn = url.openConnection();
            assertCopies(store);
            assertEquals(file.getLastModified(), conn.getLastModified());

            directRootURL = new URL("vfszip://" + rootText + testPath);
View Full Code Here

            VirtualFile parent = deploymentUnitFile.getParent();
            VirtualFile baseDir = (parent != null ? parent : deploymentUnitFile);
            VirtualFile jarFile = baseDir.getChild(jar);
            if(jarFile == null)
               throw new RuntimeException("could not find child '" + jar + "' on '" + baseDir + "'");
            return jarFile.toURL();
         }
         catch (Exception e1)
         {
            throw new RuntimeException("could not find relative path: " + jar, e1);
         }
View Full Code Here

      pi.setExcludeUnlistedClasses(metaData.isExcludeUnlistedClasses());
      VirtualFile root = di.getRootFile();
      log.debug("Persistence root: " + root);
      // TODO - update this with VFSUtils helper method
      // hack the JPA url
      URL url = root.toURL();
      // is not nested, so direct VFS URL is not an option
      if (VFSUtils.isNestedFile(root) == false)
      {
         String urlString = url.toExternalForm();
         if (urlString.startsWith("vfs"))
View Full Code Here

            throw new IllegalStateException("applyTemplate returned null virtual file.");

         try
         {
            // Distribute
            repositoryNames = distribute(deploymentName, base.toURL());
         }
         catch(Exception e)
         {
            try
            {
View Full Code Here

            // assertEquals(vfs, root.getVFS()); // this is actually the real cause
            VirtualFile file = root.getChild(testPath);
            assertNotNull(file);
            assertTrue(file.getSize() > 0);
            assertCopies(store);
            URL url = file.toURL();
            URLConnection conn = url.openConnection();
            assertCopies(store);
            assertEquals(file.getLastModified(), conn.getLastModified());

            directRootURL = new URL("vfszip://" + rootText + testPath);
View Full Code Here

      URL url = context.getRootURL();
      VirtualFile child1 = getChildHandler(context, "child1").getVirtualFile();
      VirtualFile child11 = getChildHandler(context, "child1/child1,1").getVirtualFile();
     
      VirtualFile root = VFS.getRoot(url);
      assertEquals(url, root.toURL());

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

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

     
      VirtualFile root = VFS.getRoot(url);
      assertEquals(url, root.toURL());

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

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

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

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

   public void testGetLastModfied() throws Exception
   {
      MockVFSContext context = registerSimpleVFSContext();
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.