Package com.caucho.vfs

Examples of com.caucho.vfs.Path


      DynamicClassLoader dcl = (DynamicClassLoader) parentLoader;

      dcl.make();
    }

    Path workPath = getClassDir();

    _cl = beanClass;

    fullName = _cl.getName() + suffix;

    objClass = _cl.getName();
    int p = objClass.lastIndexOf('.');
    if (p > 0)
      objClass = objClass.substring(p + 1);
   
    p = fullName.lastIndexOf('.');
    if (p > 0) {
      pkg = fullName.substring(0, p);
      className = fullName.substring(p + 1);
    }
    else
      className = fullName;

    Path path = workPath.lookup(fullName.replace('.', '/') + ".java");
    path.getParent().mkdirs();

    return path;
  }
View Full Code Here


    return null;
  }

  private String getModuleName(String classpathComponent)
  {
    Path path = Vfs.lookup(classpathComponent);
    String tail = path.getTail();
    String moduleName = classpathComponent;

    if (classpathComponent.endsWith(".jar")
        || classpathComponent.endsWith(".war")) {
      moduleName = tail.substring(0, tail.length() - ".jar".length());

      path = JarPath.create(path);
    }

    Path ejbJarXml = path.lookup("META-INF/ejb-jar.xml");

    if (ejbJarXml.canRead()) {
      String ejbJarModuleName = scanEjbJarXml(ejbJarXml);

      if (ejbJarModuleName != null)
        moduleName = ejbJarModuleName;
    }
View Full Code Here

  private void setWorkDir(Object workDirValue)
    throws EJBException
  {
    if (workDirValue != null) {
      Path workDir = null;

      if (workDirValue instanceof String) {
        workDir = Vfs.lookup((String) workDirValue);
      }
      else if (workDirValue instanceof File) {
        workDir = Vfs.lookup(((File) workDirValue).getPath());
      }
      else {
        throw new EJBException("Value of '" + WORK_DIR + "' must be either a String or java.io.File");
      }

      WorkDir.setLocalWorkDir(workDir);
    }
    else {
      Path tmpDir = Vfs.lookup(System.getProperty("java.io.tmpdir"));
      String userName = System.getProperty("user.name");
      Path workDir = tmpDir.lookup(userName).lookup("caucho-ejb");

      WorkDir.setLocalWorkDir(workDir);
    }
  }
View Full Code Here

      configFile = System.getProperty(CONFIG_FILE);
   
    if (configFile == null)
      return;
   
    Path path = Vfs.lookup(configFile);
   
    Config config = new Config();
    EnvironmentConfig configItem = new EnvironmentConfig();

    try {
View Full Code Here

    init();

    _systemId = "stream";
   
    if (is instanceof ReadStream) {
      Path path = ((ReadStream) is).getPath();
      _systemId = path.getURL();
      _filename = path.getUserPath();
     
      if (_searchPath != null) {
      }
      else if (path != null)
        _searchPath = path.getParent();

      parseInt((ReadStream) is);
    }
    else {
      ReadStream rs = VfsStream.openRead(is);
View Full Code Here

   */
  public void parseImpl(InputStream is, String systemId)
    throws IOException, SAXException
  {
    if (is instanceof ReadStream) {
      Path path = ((ReadStream) is).getPath();
     
      if (_searchPath != null) {
      }
      else if (path != null) {
        _searchPath = path.getParent();
        if (systemId != null)
          _searchPath = _searchPath.lookup(systemId).getParent();
      }
      else if (systemId != null)
        _searchPath = Vfs.lookup(systemId).getParent();

      if (systemId == null) {
        systemId = path.getURL();
        _filename = ((ReadStream) is).getUserPath();
      }
      else
        _filename = systemId;

View Full Code Here

    int slash = systemId.indexOf('/');
   
    boolean isAbsolute = colon > 0 && (colon < slash || slash < 0);
   
    if (slash == 0 || ! isAbsolute) {
      Path pwd;

      if (_searchPath != null)
        pwd = _searchPath;
      else
        pwd = Vfs.lookup(systemId).getParent();
     
      String newId = pwd.lookup(systemId).getURL();
      if (! newId.startsWith("error:"))
        systemId = newId;
      else {
        int tail = _systemId.lastIndexOf('/');
        if (tail >= 0)
View Full Code Here

    while (it.hasNext()) {

      String s = it.next();

      Path path = root.lookup(s);

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

  {
    if (root.getURL().endsWith(".jar"))
      root = JarPath.create(root);

    // XXX: ejb/0fbn
    Path ejbJar = root.lookup("META-INF/ejb-jar.xml");
    if (ejbJar.canRead()) {
      getConfigManager().configureRootPath(root);
    }
    else if (root.getURL().endsWith("WEB-INF/classes")) {
      ejbJar = root.lookup("../ejb-jar.xml");
   
      if (ejbJar.canRead()) {
        getConfigManager().configureRootPath(root);
      }
    }

    _ejbUrls.add(root.getURL());
View Full Code Here

   * Returns true if the root is a valid scannable root.
   */
  @Override
  public boolean isRootScannable(Path root, String packageRoot)
  {
    Path scanRoot = root;
   
    if (packageRoot != null)
      scanRoot = scanRoot.lookup(packageRoot.replace('.', '/'));
     
    if (_scannableRoots == null) {
      if (! Boolean.TRUE.equals(_localScanAll.get())) {
        if (! scanRoot.lookup("META-INF/ejb-jar.xml").canRead()) {
          return false;
        }
      }    
   
      if (_ejbUrls.contains(root.getURL())) {
        return false;
      }
    }
    else {
      Path path = scanRoot;

      if (root instanceof JarPath)
        path = ((JarPath) root).getContainer();

      if (! _scannableRoots.contains(path))
View Full Code Here

TOP

Related Classes of com.caucho.vfs.Path

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.