Package com.caucho.vfs

Examples of com.caucho.vfs.Path.canRead()


    StringBuilder lines = new StringBuilder();

    try {
      Path path = Vfs.lookup(_systemId);

      if (path.canRead()) {
        ReadStream is = path.openRead();

        lines.append("\n");

        try {
View Full Code Here


      if (! rarName.endsWith(".rar"))
        continue;

      Path path = rarDir.lookup(rarName);

      if (! path.canRead())
        continue;

      appName = rarName.substring(0, rarName.length() - 4);

      if (CauchoSystem.isCaseInsensitive())
View Full Code Here

      addJars((DynamicClassLoader) loader, _rootDir);
      addNative((DynamicClassLoader) loader, _rootDir);
     
      Path raXml = _rootDir.lookup("META-INF/ra.xml");

      if (! raXml.canRead())
        throw new ConfigException(L.l("missing ra.xml for rar {0}.  .rar files require a META-INF/ra.xml file.",
                                      _rarPath));

      _config = new ConnectorConfig();
View Full Code Here

  private void expandRar()
    throws IOException
  {
    Path rar = _rarPath;
   
    if (! rar.canRead())
      return;

    try {
      _rootDir.mkdirs();
    } catch (Throwable e) {
View Full Code Here

    Path expandDir = _rootDir;
    Path tempDir = _rootDir.getParent().lookup(".temp");
    Path dependPath = _rootDir.lookup("META-INF/resin-rar.timestamp");

      // XXX: change to a hash
    if (dependPath.canRead()) {
      ReadStream is = null;
      ObjectInputStream ois = null;
      try {
        is = dependPath.openRead();
        ois = new ObjectInputStream(is);
View Full Code Here

  {
    Path rootDir = _webApp.getRootDirectory();
    String realPath = _webApp.getRealPath(pathName);
    Path path = rootDir.lookupNative(realPath);

    if (path.isFile() && path.canRead())
      return path;

    java.net.URL url;
    ClassLoader loader = _webApp.getClassLoader();
    if (loader != null) {
View Full Code Here

      if (url != null && (name.endsWith(".jar") || name.endsWith(".zip")))
        path = JarPath.create(Vfs.lookup(url.toString())).lookup(pathName);
      else if (url != null)
        path = Vfs.lookup(url.toString());

      if (path != null && path.isFile() && path.canRead())
        return path;
    }

    url = ClassLoader.getSystemResource(pathName);
    String name = url != null ? url.toString() : null;
View Full Code Here

    if (url != null && (name.endsWith(".jar") || name.endsWith(".zip")))
      path = JarPath.create(Vfs.lookup(url.toString())).lookup(pathName);
    else if (url != null)
      path = Vfs.lookup(url.toString());

    if (path != null && path.isFile() && path.canRead())
      return path;
    else
      return null;
  }
View Full Code Here

        dynLoader.addLoader(new CompilingLoader(dynLoader, appDir.lookup("WEB-INF/classes")));
        dynLoader.addLoader(new DirectoryLoader(dynLoader, appDir.lookup("WEB-INF/lib")));

        Path webXml = appDir.lookup("WEB-INF/web.xml");

        if (webXml.canRead()) {
          try {
            new Config().configureBean(app, webXml);
          } catch (Exception e) {
            log.log(Level.WARNING, e.toString(), e);
          }
View Full Code Here

        return false;
    }
   
    Path expandHash = rootDirectory.lookup(ExpandDeployController.APPLICATION_HASH_PATH);

    if (expandHash.canRead()) {
      log.finer(this + " " + rootDirectory + " contains an application hash");
      return false;
    }
   
    return true;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.