Package org.jboss.vfs

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


   public URL getResource(String name)
   {
      try
      {
         VirtualFile child = root.getChild(name);
         return child.exists() ? child.toURL() : null;
      }
      catch (MalformedURLException e)
      {
         return null;
      }
View Full Code Here


      {
         VirtualFile child = root.getChild(name);
         if (child.exists())
         {
            Vector<URL> vector = new Vector<URL>();
            vector.add(child.toURL());
            return vector.elements();
         }
         else
            return null;
      }
View Full Code Here

   public void deploy(VFSDeploymentUnit unit) throws DeploymentException
   {
      try
      {
         VirtualFile classes = VFS.getChild(createHost(unit));
         URL dynamicClassRoot = classes.toURL();
         Closeable closeable = VFS.mountTemp(classes, tempFileProvider);
         unit.addAttachment(MOUNT_HANDLE_KEY, closeable);
         unit.addAttachment(DYNAMIC_CLASS_KEY, classes);
         unit.addAttachment(DYNAMIC_CLASS_URL_KEY, dynamicClassRoot);
         unit.prependClassPath(classes);
View Full Code Here

        try {
            final VirtualFile file = root.getChild(PathUtils.canonicalize(name));
            if (!file.exists()) {
                return null;
            }
            return new VFSEntryResource(file, file.toURL());
        } catch (MalformedURLException e) {
            // must be invalid...?  (todo: check this out)
            return null;
        }
    }
View Full Code Here

   {
      try
      {
         VirtualFile file = findFile(className);
         if (file != null)
            return file.toURL();
      }
      catch (Exception ignored)
      {
      }
      return null;
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

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.