Package com.caucho.env.git

Examples of com.caucho.env.git.GitObjectStream


   * Writes the contents to a stream.
   */
  @Override
  public void writeBlobToStream(String blobHash, OutputStream os)
  {
    GitObjectStream is = null;
   
    try {
      is = _git.open(blobHash);
   
      if (is.getType() != GitType.BLOB)
        throw new RepositoryException(L.l("'{0}' is an unexpected type, expected 'blob'",
                                                is.getType()));

      WriteStream out = null;

      if (os instanceof WriteStream)
        out = (WriteStream) os;
      else
        out = Vfs.openWrite(os);

      try {
        out.writeStream(is.getInputStream());
      } finally {
        if (out != null && out != os)
          out.close();
      }
    } catch (IOException e) {
      throw new RepositoryException(e);
    } finally {
      is.close();
    }
  }
View Full Code Here

TOP

Related Classes of com.caucho.env.git.GitObjectStream

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.