Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.PacketLineOut


  }

  private static void sendInfoRefsError(HttpServletRequest req,
      HttpServletResponse res, String textForGit) throws IOException {
    ByteArrayOutputStream buf = new ByteArrayOutputStream(128);
    PacketLineOut pck = new PacketLineOut(buf);
    String svc = req.getParameter("service");
    pck.writeString("# service=" + svc + "\n");
    pck.end();
    pck.writeString("ERR " + textForGit);
    send(req, res, infoRefsResultType(svc), buf.toByteArray());
  }
View Full Code Here


  }

  private static void sendUploadPackError(HttpServletRequest req,
      HttpServletResponse res, String textForGit) throws IOException {
    ByteArrayOutputStream buf = new ByteArrayOutputStream(128);
    PacketLineOut pckOut = new PacketLineOut(buf);

    boolean sideband;
    UploadPack up = (UploadPack) req.getAttribute(ATTRIBUTE_HANDLER);
    if (up != null) {
      try {
View Full Code Here

  }

  private static void sendReceivePackError(HttpServletRequest req,
      HttpServletResponse res, String textForGit) throws IOException {
    ByteArrayOutputStream buf = new ByteArrayOutputStream(128);
    PacketLineOut pckOut = new PacketLineOut(buf);

    boolean sideband;
    ReceivePack rp = (ReceivePack) req.getAttribute(ATTRIBUTE_HANDLER);
    if (rp != null) {
      try {
View Full Code Here

    final HttpServletResponse res = (HttpServletResponse) response;
    final SmartOutputStream buf = new SmartOutputStream(req, res);
    try {
      res.setContentType(infoRefsResultType(svc));

      final PacketLineOut out = new PacketLineOut(buf);
      out.writeString("# service=" + svc + "\n");
      out.end();
      advertise(req, new PacketLineOutRefAdvertiser(out));
      buf.close();
    } catch (ServiceNotAuthorizedException e) {
      res.sendError(SC_UNAUTHORIZED);
View Full Code Here

    try {
      db = client.getDaemon().openRepository(client, name);
    } catch (ServiceMayNotContinueException e) {
      // An error when opening the repo means the client is expecting a ref
      // advertisement, so use that style of error.
      PacketLineOut pktOut = new PacketLineOut(client.getOutputStream());
      pktOut.writeString("ERR " + e.getMessage() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
      db = null;
    }
    if (db == null)
      return;
    try {
View Full Code Here

  }

  private static void sendUploadPackError(HttpServletRequest req,
      HttpServletResponse res, String textForGit) throws IOException {
    ByteArrayOutputStream buf = new ByteArrayOutputStream(128);
    PacketLineOut pckOut = new PacketLineOut(buf);

    boolean sideband;
    UploadPack up = (UploadPack) req.getAttribute(ATTRIBUTE_HANDLER);
    if (up != null) {
      try {
View Full Code Here

  }

  private static void sendReceivePackError(HttpServletRequest req,
      HttpServletResponse res, String textForGit) throws IOException {
    ByteArrayOutputStream buf = new ByteArrayOutputStream(128);
    PacketLineOut pckOut = new PacketLineOut(buf);

    boolean sideband;
    ReceivePack rp = (ReceivePack) req.getAttribute(ATTRIBUTE_HANDLER);
    if (rp != null) {
      try {
View Full Code Here

  }

  private static void sendInfoRefsError(HttpServletRequest req,
      HttpServletResponse res, String textForGit) throws IOException {
    ByteArrayOutputStream buf = new ByteArrayOutputStream(128);
    PacketLineOut pck = new PacketLineOut(buf);
    String svc = req.getParameter("service");
    pck.writeString("# service=" + svc + "\n");
    pck.end();
    pck.writeString("ERR " + textForGit);
    send(req, res, infoRefsResultType(svc), buf.toByteArray());
  }
View Full Code Here

    sb.append("refs/objects/A");
    sb.append('\0');
    sb.append("report-status");

    ByteArrayOutputStream reqbuf = new ByteArrayOutputStream();
    PacketLineOut reqpck = new PacketLineOut(reqbuf);
    reqpck.writeString(sb.toString());
    reqpck.end();

    packHeader(reqbuf, 1);

    byte[] reqbin = reqbuf.toByteArray();
View Full Code Here

      try {
        final Repository db = getRepository(req);
        rsp.setContentType("application/x-" + svc + "-advertisement");

        final SmartOutputStream buf = new SmartOutputStream(req, rsp);
        final PacketLineOut out = new PacketLineOut(buf);
        out.writeString("# service=" + svc + "\n");
        out.end();
        advertise(req, db, new PacketLineOutRefAdvertiser(out));
        buf.close();
      } catch (ServiceNotAuthorizedException e) {
        rsp.sendError(SC_UNAUTHORIZED);
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.transport.PacketLineOut

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.