Package org.jboss.vfs

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


        try {
            final VirtualFile file = root.getChild(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


                VirtualFile parent = deploymentUnitFile.getParent().getParent().getParent();
                VirtualFile baseDir = (parent != null ? parent : deploymentUnitFile);
                VirtualFile jarFile = baseDir.getChild(jar);
                if (jarFile == null)
                    throw MESSAGES.childNotFound(jar, baseDir);
                return jarFile.toURL();
            } catch (Exception e1) {
                throw MESSAGES.relativePathNotFound(e1, jar);
            }
        }
    }
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

    private void writeObject(ObjectOutputStream out) throws IOException, URISyntaxException {
        VirtualFile file = getFile();
        URL url = rootUrl;
        if (url == null) {
            VirtualFile parentFile = file.getParent();
            url = parentFile != null ? parentFile.toURL() : null;
        }
        String pathName = path;
        if (pathName == null)
            pathName = file.getName();
View Full Code Here

                  else
                  {
                     ofactory = new StructureMetaDataObjectFactory();
                  }

                  URL url = jbossStructure.toURL();
                  UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
                  Unmarshaller unmarshaller = factory.newUnmarshaller();
                  unmarshaller.unmarshal(url.toString(), ofactory, structureContext.getMetaData());
                  mountChildren(structureContext);
                  isJBossStructure = true;
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

    private void writeObject(ObjectOutputStream out) throws IOException, URISyntaxException {
        VirtualFile file = getFile();
        URL url = rootUrl;
        if (url == null) {
            VirtualFile parentFile = file.getParent();
            url = parentFile != null ? parentFile.toURL() : null;
        }
        String pathName = path;
        if (pathName == null)
            pathName = file.getName();
View Full Code Here

      VirtualFile child = findChild(path);
      if (child != null)
      {
         try
         {
            return child.toURL();
         }
         catch (Exception ignored)
         {
            log.debug("Error determining URL for " + child, ignored);
            return null;
View Full Code Here

      {
         try
         {
            VirtualFile child = root.getChild(name);
            if (child.exists())
               urls.add(child.toURL());
         }
         catch (Exception e)
         {
            log.debug("Error getting resources for " + root, e);
         }
View Full Code Here

      if (root != null)
      {
         try
         {
            rootURL = root.toURL().toString();
            manifest = manifestCache.get(rootURL);
            if (manifest == null)
            {
               manifest = VFSUtils.getManifest(root);
               if (manifest == 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.