Package com.caucho.vfs

Examples of com.caucho.vfs.ReadStream


  /**
   * closes the stream.
   */
  void closeImpl()
  {
    ReadStream is = _is;
    _is = null;

    WriteStream os = _os;
    _os = null;

    try {
      if (is != null)
        is.close();
    } catch (Throwable e) {
      log.log(Level.FINER, e.toString(), e);
    }

    try {
View Full Code Here


    return ch;
  }

  public void close()
  {
    ReadStream is = _is;
    _is = null;

    if (is != null) {
      is.close();
    }
  }
View Full Code Here

    return new IOException(msg);
  }

  public void close()
  {
    ReadStream is = _is;
    _is = null;
   
    WriteStream os = _os;
    _os = null;

    _in.close();

    if (os != null) {
      try {
        os.close();
      } catch (IOException e) {
      }
    }

    if (is != null) {
      is.close();
    }
  }
View Full Code Here

      if (! path.getPath().endsWith(".class"))
        return;

      matcher.init(root, path);

      ReadStream is = path.openRead();
     
      try {
        classScanner.init(path.getPath(), is, matcher);

        classScanner.scan();
      } finally {
        is.close();
      }
    } catch (IOException e) {
      log.log(Level.FINE, e.toString(), e);
    }
  }
View Full Code Here

        if (packagePath != null && ! entryName.startsWith(packagePath))
          continue;

        matcher.init();

        ReadStream is = Vfs.openRead(zipFile.getInputStream(entry));
        try {
          classScanner.init(entryName, is, matcher);

          if (classScanner.scan())
            isScanMatch = true;
        } finally {
          is.close();
        }
      }
     
      if (! isScanMatch)
        addNullScanPath(path);
View Full Code Here

    InputStream is = null;

    try {
      is = url.openStream();

      ReadStream in = Vfs.openRead(is);
      String line;
      while ((line = in.readLine()) != null) {
        line = line.trim();

        if (! "".equals(line) && ! line.startsWith("#")) {
          return Class.forName(line, false, loader);
        }
View Full Code Here

  {
    toDuplexActive();

    RequestState result;

    ReadStream readStream = getReadStream();

    while ((result = processKeepalive()) == RequestState.REQUEST_COMPLETE) {
      long position = readStream.getPosition();

      duplex.serviceRead();

      if (position == readStream.getPosition()) {
        log.warning(duplex + " was not processing any data. Shutting down.");
       
        close();

        return RequestState.EXIT;
View Full Code Here

  private boolean parseRequest()
    throws IOException
  {
    try {
      ReadStream is = getRawRead();

      if (! readRequest(is)) {
        clearRequest();

        return false;
View Full Code Here

      manifestPath = jar.lookup("META-INF/MANIFEST.MF");
      contextPath = path.getParent();
    }

    if (manifestPath.canRead()) {
      ReadStream is = manifestPath.openRead();
      try {
        Manifest manifest = new Manifest(is);

        Attributes main = manifest.getMainAttributes();

        String classPath = main.getValue("Class-Path");

        addManifestClassPath(classPath, contextPath);
      } catch (IOException e) {
        log().log(Level.WARNING, e.toString(), e);

        return;
      } finally {
        is.close();
      }
    }
  }
View Full Code Here

  }

  public static void writeFile(WriteStream os, Path path)
    throws IOException
  {
    ReadStream stream = path.openRead();
   
    try {
      os.writeStream(stream);
    } finally {
      stream.close();
    }
  }
View Full Code Here

TOP

Related Classes of com.caucho.vfs.ReadStream

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.