Package com.caucho.git

Examples of com.caucho.git.GitObjectStream


  /**
   * Writes the contents to a stream.
   */
  public void writeToStream(OutputStream os, String sha1)
  {
    GitObjectStream is = null;
   
    try {
      is = _git.open(sha1);
   
      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.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.