Package com.caucho.vfs

Examples of com.caucho.vfs.Path


    if (servletPath != null)
      realPath = request.getServletContext().getRealPath(servletPath);
    else
      realPath = request.getServletContext().getRealPath(request.getPathInfo());

    Path path = Vfs.lookup(realPath);

    return path.exists() && path.isFile();
  }
View Full Code Here


  }
 
  public void start()
  {
    try {
      Path dataDirectory = RootDirectorySystem.getCurrentDataDirectory();

      String serverId = ResinSystem.getCurrentId();


      if (serverId.isEmpty())
View Full Code Here

    }

    // String contextUri = invocation.getContextURI();
   
    try {
      Path path = _webApp.getCauchoPath(uri);

      if (! path.exists())
        return null;
    } catch (Exception e) {
      if (log.isLoggable(Level.FINER))
        log.log(Level.FINER, L.l(
                                 "can't match a welcome file path {0}",
View Full Code Here

    }
  }
 
  private DataSource createDataSource(Path dataDirectory, String serverId)
  {
    Path path = dataDirectory.lookup("distcache");

    if (path == null)
      throw new NullPointerException();

    try {
      path.mkdirs();
    } catch (IOException e) {
    }

    try {
      DataSourceImpl dataSource = new DataSourceImpl();
View Full Code Here

      parentLoader = Thread.currentThread().getContextClassLoader();

    _loader = EnvironmentClassLoader.create(parentLoader, "eapp:" + name);
   
    if (_controller != null) {
      Path entAppRoot = _controller.getRootDirectory();

      // XXX: restrict to META-INF?
      ResourceLoader loader = new ResourceLoader(_loader, entAppRoot);
      loader.init();

      _webappsPath = entAppRoot.lookup("webapps");
      WorkDir.setLocalWorkDir(entAppRoot.lookup("META-INF/work"),
                              _loader);
    }

    _lifecycle = new Lifecycle(log, toString(), Level.INFO);
View Full Code Here

  {
    if (! _lifecycle.toInit())
      return;

    try {
      Path rootDir = getRootDirectory();
     
      Vfs.setPwd(rootDir, _loader);

      _loader.addJarManifestClassPath(rootDir);

      // server/13bb vs TCK
      if ("1.4".equals(_version)) {
        // XXX: tck ejb30/persistence/basic needs to add the lib/*.jar
        // to find the META-INF/persistence.xml
        fillDefaultLib();
      }
      else {
        fillDefaultModules();
      }

      EjbManager ejbManager = EjbManager.create();

      if (_ejbPaths.size() != 0) {
        for (Path path : _ejbPaths) {
          // ejbManager.addRoot(path);
          _loader.addJar(path);
        }

        _loader.validate();

      // XXX:??
      /*
      */

        // starts with the environment
        // ejbServer.start();
      }
   
      // ioc/0p63
      Path ejbJar = rootDir.lookup("META-INF/ejb-jar.xml");

      if (ejbJar.canRead()) {
        ejbManager.configureRootPath(rootDir);
      }

      _loader.start();

View Full Code Here

  private void fillDefaultModules()
  {
    try {
      fillDefaultLib();

      Path rootDir = getRootDirectory();
     
      for (String file : rootDir.list()) {
        if (file.endsWith(".jar")) {
          Path path = rootDir.lookup(file);
          Path jar = JarPath.create(path);

          try {
            if (jar.lookup("META-INF/application-client.xml").canRead()) {
              // app-client jar
            }
            else if (jar.lookup("META-INF/ejb-jar.xml").canRead()) {
              addEjbPath(path);

              _loader.addJar(path);
              _loader.addJarManifestClassPath(path);
            }
View Full Code Here

    // ejb/0fa0
    if (_libraryDirectory != null)
      libDir = _libraryDirectory;
   
    Path rootDir = getRootDirectory();

    if (rootDir.lookup(libDir).isDirectory()) {
      Path lib = rootDir.lookup(libDir);

      for (String file : lib.list()) {
        if (file.endsWith(".jar")) {
          _loader.addJar(lib.lookup(file));
        }
      }
    }
  }
View Full Code Here

  void initWeb(WebModule web)
  {
    String webUri = web.getWebURI();
    String contextUrl = web.getContextRoot();
    Path path = getRootDirectory().lookup(webUri);
    Path archivePath = null;

    if (contextUrl == null)
      contextUrl = webUri;

    WebAppController controller = null;

    if (webUri.endsWith(".war")) {
      // server/2a16
      String name = webUri.substring(0, webUri.length() - 4);
      int p = name.lastIndexOf('/');
      if (p > 0)
        name = name.substring(p + 1);

      // XXX:
      if (contextUrl.equals(""))
        contextUrl = "/" + name;

      if (contextUrl.endsWith(".war"))
        contextUrl = contextUrl.substring(0, contextUrl.length() - 4);

      Path expandPath = _webappsPath;

      try {
        expandPath.mkdirs();
      } catch (Exception e) {
        log.log(Level.WARNING, e.toString(), e);
      }

      archivePath = path;
      path = expandPath.lookup(name);
    } else {
      // server/2a15
      if (contextUrl.equals("")) {
        String name = webUri;
        int p = name.lastIndexOf('/');
View Full Code Here

    super(deployContainer);
   
    _parentContainer = parentContainer;
   
    String id = "production/entapp/default/default";
    Path rootDirectory = config.calculateRootDirectory();

    _controller = new EarDeployController(id, rootDirectory, "",
                                          parentContainer, config);
  }
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.