Package org.jboss.virtual

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


   @SuppressWarnings("deprecation")
   protected static VirtualFile resolveVirtualFile(URL vfsurl, String relativePath) throws IOException
   {
      VirtualFile file = VFS.getRoot(vfsurl);
      return file.findChild(relativePath);
   }

   /**
    * Get the virtual file.
    *
 
View Full Code Here


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

      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

      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("/"));
   }

   /**
    * Test copying a jar
View Full Code Here

      replacement = modify(original);
      assertTopLevelParent(original.getParent(), replacement.getParent());

      VirtualFile child = replacement.findChild("jar1.jar");
      assertNotNull(child);
      assertNotNull(child.findChild("META-INF/MANIFEST.MF"));
      assertNotNull(replacement.findChild("jar2.jar"));
   }

   protected void assertTopLevelParent(VirtualFile originalParent, VirtualFile replacementParent) throws Exception
   {
View Full Code Here

         public Enumeration<URL> getResources(String name) throws IOException
         {
            try
            {
               List<URL> urls = new ArrayList<URL>();
               urls.add(nested.findChild(name).toURL());
               urls.add(vfs.findChild(name).toURL());
               return Iterators.toEnumeration(urls.iterator());
            }
            catch (Exception e)
            {
View Full Code Here

   public VirtualFile getFile() throws IOException
   {
      if (file == null)
      {
         VirtualFile root = VFS.getRoot(rootUrl);
         file = root.findChild(path);
      }
      return file;
   }

   // write just url and path
View Full Code Here

/*    */     {
/* 58 */       child = child.substring(3);
/* 59 */       vf = vf.getParent();
/*    */     }
/*    */
/* 62 */     vf = vf.findChild(child);
/* 63 */     return new VirtualFileAdaptor(vf);
/*    */   }
/*    */
/*    */   public URL toURL()
/*    */   {
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.