Package com.caucho.vfs

Examples of com.caucho.vfs.JarPath


      if (path.isDirectory()) {
        addJarUrls(loader, path);
      }
      else if (s.endsWith(".jar")) {
        JarPath jarPath = JarPath.create(path);

        loader.addURL(jarPath);
      }
    }
  }
View Full Code Here


    if (packageRoot != null)
      packagePath = packageRoot.replace('.', '/');

    if (root instanceof JarPath) {
      JarPath jarRoot = (JarPath) root;
      Path jar = jarRoot.getContainer();
     
      JarByteCodeMatcher matcher
        = new JarByteCodeMatcher(loader, root, packageRoot, listeners);

      scanForJarClasses(jar, packageRoot,
View Full Code Here

    if (path.isDirectory()) {
      manifestPath = path.lookup("META-INF/MANIFEST.MF");
      contextPath = path;
    }
    else {
      JarPath jar = JarPath.create(path);
      manifestPath = jar.lookup("META-INF/MANIFEST.MF");
      contextPath = path.getParent();
    }

    if (manifestPath.canRead()) {
      ReadStream is = manifestPath.openRead();
View Full Code Here

    return new Entry(jarPath, null, null);
  }

  private Artifact readPom(Path jarPath, String key)
  {
    JarPath jar = JarPath.create(jarPath);

    try {
      MavenProject project = new MavenProject();

      new Config().configure(project, jar.lookup(key));

      Artifact artifact = project.toArtifact(jarPath);

      return artifact;
    } catch (IOException e) {
View Full Code Here

    throws JspParseException, IOException
  {
    if (! jarBacking.canRead())
      return;

    JarPath jar = JarPath.create(jarBacking);

    ArrayList<Path> tldPaths = new ArrayList<Path>();

    boolean isValidScan = false;

    ZipScanner scan = null;
    try {
      if (true)
        scan = new ZipScanner(jarBacking);

      if (scan != null && scan.open()) {
        while (scan.next()) {
          String name = scan.getName();

          if (name.startsWith(prefix)
              && name.endsWith(".tld") || name.endsWith(".ftld")) {
            tldPaths.add(jar.lookup(name));
          }
        }

        isValidScan = true;
      }
    } catch (Exception e) {
      log.log(Level.INFO, e.toString(), e);
    }

    if (! isValidScan) {
      ZipFile zipFile = jar.getJar().getZipFile();
     
      try {
        Enumeration<? extends ZipEntry> en = zipFile.entries();
        while (en.hasMoreElements()) {
          ZipEntry entry = en.nextElement();
          String name = entry.getName();

          if (name.startsWith(prefix)
              && (name.endsWith(".tld") || name.endsWith(".ftld"))) {
            tldPaths.add(jar.lookup(name));
          }
        }
      } finally {
        jar.getJar().closeZipFile(zipFile);
      }
    }

    for (Path path : tldPaths) {
      try {
View Full Code Here

      if (path.isDirectory()) {
        addJarUrls(loader, path);
      }
      else if (s.endsWith(".jar")) {
        JarPath jarPath = JarPath.create(path);

        loader.addURL(jarPath);
      }
    }
  }
View Full Code Here

   */
  public void addEar(Path path)
  {
    System.out.println("ADD EAR: " + path);
   
    JarPath jar = JarPath.create(path);

    Path app = jar.lookup("META-INF/application.xml");

    System.out.println("  APP: " + app + " " + app.exists());

    if (app.exists())
      addConfig(app);

    app = jar.lookup("META-INF/resin-application.xml");

    System.out.println("  APP: " + app + " " + app.exists());

    if (app.exists())
      addConfig(app);
View Full Code Here

    return new Entry(jarPath, null, null);
  }

  private Artifact readPom(Path jarPath, String key)
  {
    JarPath jar = JarPath.create(jarPath);

    try {
      MavenProject project = new MavenProject();

      new Config().configure(project, jar.lookup(key));

      Artifact artifact = project.toArtifact(jarPath);

      return artifact;
    } catch (IOException e) {
View Full Code Here

      + String.format("%o", jar.getMode())
      + " path=" + jar.getNativePath() + ")");
      return;
    }
   
    JarPath jarPath = JarPath.create(jar);
    JarEntry jarEntry = new JarEntry(jarPath);

    if (getClassLoader() != null) {
      if (! getClassLoader().addURL(jarPath))
  return;
View Full Code Here

  @Override
  protected void buildClassPath(ArrayList<String> pathList)
  {
    for (int i = 0; i < _jarList.size(); i++) {
      JarEntry jarEntry = _jarList.get(i);
      JarPath jar = jarEntry.getJarPath();
     
      String path = jar.getContainer().getNativePath();

      if (! pathList.contains(path))
  pathList.add(path);
    }
  }
View Full Code Here

TOP

Related Classes of com.caucho.vfs.JarPath

Copyright © 2018 www.massapicom. 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.