Package com.caucho.vfs

Examples of com.caucho.vfs.MergePath


   
    if (className == null)
      className = "_js." + JavaCompiler.mangleName(name);
     
    if (scriptPath == null) {
      MergePath mergePath = new MergePath();
      if (is.getPath() != null)
        mergePath.addMergePath(is.getPath().getParent());
      else
        mergePath.addMergePath(Vfs.lookup());
      ClassLoader parentLoader = this.parentLoader;
      if (parentLoader == null)
        parentLoader = Thread.currentThread().getContextClassLoader();
     
      mergePath.addClassPath(parentLoader);
      scriptPath = mergePath;
    }
   
    block = null;
View Full Code Here


      int p;
      if ((p = name.lastIndexOf('/')) >= 0) {
  Path subpath = Vfs.lookupNative(name.substring(0, p));

        MergePath mergePath = new MergePath();
        mergePath.addMergePath(Vfs.lookup());
        mergePath.addMergePath(subpath);
        mergePath.addMergePath(CauchoSystem.getResinHome().lookup("scripts"));
        mergePath.addClassPath(Thread.currentThread().getContextClassLoader());
        scriptPath = mergePath;
      }

      Parser parser = new Parser();
      parser.setScriptPath(scriptPath);
View Full Code Here

  public static Schema compileFromResource(String schemaName)
    throws SAXException, IOException
  {
    CompactVerifierFactoryImpl factory = new CompactVerifierFactoryImpl();

    MergePath mp = new MergePath();
    mp.addClassPath();
 
    return factory.compileSchema(mp.lookup(schemaName));
  }
View Full Code Here

   * jars inside that folder are also searched for fonts.
   */
  public Font parse(String webInfLibPath, String name)
    throws IOException
  {
    MergePath mergePath = new MergePath();
    mergePath.addClassPath();

    File webInfLibFile = new File(webInfLibPath);
    if(webInfLibPath != null && !webInfLibPath.isEmpty() && webInfLibFile.isDirectory())
    {
      Path webInfPath = Vfs.lookup(webInfLibFile.getAbsolutePath());
      for( File f : webInfLibFile.listFiles())
      {
        /*
        only look for files that are either jars or zips
         */
        if(f.isFile() && (f.getAbsolutePath().endsWith(".jar") || f.getAbsolutePath().endsWith(".zip")))
        {
          /*
          get a path object with the Jar relative to WEB-INF/lib
           */
          Path jarPath = webInfPath.lookup(f.getName());
          /*
            Encapsulate it as a JarPath, else mergePath.lookup does not look
            "into" the jar when looking for resources
           */
          mergePath.addMergePath(JarPath.create(jarPath));
        }
      }
    }

    Path path = mergePath.lookup("com/caucho/quercus/lib/pdf/font/" + name + ".afm");

    if (! path.canRead())
      throw new FileNotFoundException(L.l("Can't find font {0}", name));

    _is = path.openRead();
View Full Code Here

  /**
   * Returns the default merge path
   */
  public static Path getDefaultSearchPath()
  {
    MergePath mergePath = new MergePath();
   
    mergePath.addMergePath(Vfs.lookup());
    mergePath.addClassPath();

    return mergePath;
  }
View Full Code Here

  public static Schema compileFromResource(String schemaName)
    throws SAXException, IOException
  {
    CompactVerifierFactoryImpl factory = new CompactVerifierFactoryImpl();

    MergePath mp = new MergePath();
    mp.addClassPath();

    return factory.compileSchema(mp.lookup(schemaName));
  }
View Full Code Here

TOP

Related Classes of com.caucho.vfs.MergePath

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.