Package com.caucho.vfs

Examples of com.caucho.vfs.Path


  private ArrayList<String> buildResinArgs(int socketPort)
  {
    ArrayList<String> resinArgs = new ArrayList<String>();

    Path resinRoot = _watchdog.getResinRoot();

    if (resinRoot != null) {
      resinArgs.add("--root-directory");
      resinArgs.add(resinRoot.getFullPath());
    }
   
    if (_watchdog.getResinConf() != null) {
      resinArgs.add("-conf");
      resinArgs.add(_watchdog.getResinConf().getNativePath());
View Full Code Here


  {
    if (_watchdog.isConsole()) {
      return Vfs.openWrite(System.out);
    }

    Path jvmPath = _watchdog.getLogPath();

    try {
      Path dir = jvmPath.getParent();

      if (! dir.exists()) {
        dir.mkdirs();

        String userName = _watchdog.getUserName();
        if (userName != null)
          dir.changeOwner(userName);

        String groupName = _watchdog.getGroupName();
        if (groupName != null)
          dir.changeGroup(groupName);
      }
    } catch (Exception e) {
      log.log(Level.WARNING, e.toString(), e);
    }
View Full Code Here

  private long getLastModified()
  {
    long lastModified = 0;
    for (int i = 0; i < _depends.size(); i++) {
      Path path = _depends.get(i);
      if (path.getLastModified() > lastModified)
        lastModified = path.getLastModified();
    }

    return lastModified;
  }
View Full Code Here

    pushDepth();
    println("super.init(path);");
    println("com.caucho.vfs.Path pwd = path.getParent();");

    for (int i = 0; i < _depends.size(); i++) {
      Path path = _depends.get(i);
     
      if (path.canRead() && ! path.isDirectory()) {
        Depend depend = new Depend(path);
        print("addDepend(new com.caucho.vfs.Depend(pwd.lookup(\"");
        printString(path.getRelativePath());
        println("\"), " + depend.getDigest() + "L));");
      }
    }

    println("stylesheets = new StylesheetEnv[" + _stylesheets.size() + "];");
View Full Code Here

  /**
   * Adds a new module (jar or exploded classes directory)
   */
  public void addClassPath(String classPath)
  {
    Path path = Vfs.lookup(classPath);

    if (classPath.endsWith(".jar")) {
      _classLoader.addJar(path);
    } else {
      CompilingLoader loader = new CompilingLoader(_classLoader);
View Full Code Here

   * @param packageName
   *          the name of the package to be treated as a virtual module root.
   */
  public void addPackageModule(String modulePath, String packageName)
  {
    Path root = Vfs.lookup(modulePath);

    try {
      URL url = new URL(root.getURL());

      _classLoader.addScanPackage(url, packageName);
    } catch (Exception e) {
      throw ConfigException.create(e);
    }
View Full Code Here

          continue;
        }

        URL urlA = bestUrl;

        Path pathA = Vfs.lookup(urlA);
        Path pathB = Vfs.lookup(url);

        for (String name : pathA.list()) {
          if (name.endsWith(".class")) {
            bestUrl = urlA;
            break;
          }
        }

        for (String name : pathB.list()) {
          if (name.endsWith(".class")) {
            bestUrl = url;
            break;
          }
        }
      }

      if (bestUrl == null)
        throw new NullPointerException(packageName);

      Path path = Vfs.lookup(bestUrl);

      String moduleName = path.getNativePath();

      if (moduleName.endsWith(packageName.replace('.', '/'))) {
        int prefixLength = moduleName.length() - packageName.length();
        moduleName = moduleName.substring(0, prefixLength);
      }
View Full Code Here

    ClassLoader oldLoader = thread.getContextClassLoader();
   
    try {
      thread.setContextClassLoader(getClassLoader());

      Path path = Vfs.lookup(pathName);

      // support/041a
      /*
      if (_modulePath != null)
        _cdiManager.addBeansXmlOverride(_modulePath, path);
View Full Code Here

    String stage = args.getArg("-stage");
   
    if (stage != null)
      commit.stage(stage);
   
    Path path = Vfs.lookup(war);
   
    if (name == null) {
      String tail = path.getTail();
     
      int p = tail.lastIndexOf('.');

      name = tail.substring(0, p);
    }
   
    commit.tagKey(host + "/" + name);

    /*
    String tag = args.getArg("-tag");
    if (tag != null)
      commit.tagKey(tag);
      */
   
    if (! path.isFile()) {
      throw new ConfigException(L.l("'{0}' is not a readable file.",
                                    path.getFullPath()));
    }
   
    String message = args.getArg("-m");
   
    if (message == null)
View Full Code Here

  ResinBoot(String []argv)
    throws Exception
  {
    _args = new WatchdogArgs(argv);

    Path resinHome = _args.getResinHome();

    ClassLoader loader = ProLoader.create(resinHome, _args.is64Bit());

    if (loader != null) {
      System.setProperty("resin.home", resinHome.getNativePath());

      Thread.currentThread().setContextClassLoader(loader);

      Environment.init();

      Vfs.initJNI();

      resinHome = Vfs.lookup(resinHome.getFullPath());

      _args.setResinHome(resinHome);
    }
    else {
      Environment.init();
    }
   
    String jvmVersion = System.getProperty("java.runtime.version");
   
    if ("1.6".compareTo(jvmVersion) > 0) {
      throw new ConfigException(L().l("Resin requires Java 1.6 or later but was started with {0}",
                                      jvmVersion));
    }

    // required for license check
    System.setProperty("resin.home", resinHome.getNativePath());

    // watchdog/0210
    // Vfs.setPwd(_rootDirectory);

    if (! _args.getResinConf().canRead()) {
      throw new ConfigException(L().l("Resin/{0} can't open configuration file '{1}'",
                                      VersionFactory.getVersion(),
                                      _args.getResinConf().getNativePath()));
    }
   
    Path rootDirectory = _args.getRootDirectory();
    Path dataDirectory = rootDirectory.lookup("watchdog-data");

    ResinSystem system = new ResinSystem("watchdog",
                                         rootDirectory,
                                         dataDirectory);
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.