Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.PacketLineOut.writeString()


  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


    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());
  }

  private static void sendUploadPackError(HttpServletRequest req,
      HttpServletResponse res, String textForGit) throws IOException {
View Full Code Here

    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

      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

    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());
  }

  private static void sendUploadPackError(HttpServletRequest req,
      HttpServletResponse res, String textForGit) throws IOException {
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('\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

        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

    public static byte[] gitAdvertise(Project project, String service, Response response) throws IOException {
        response.setContentType("application/x-" + service + "-advertisement");

        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        PacketLineOut packetLineOut = new PacketLineOut(byteArrayOutputStream);
        packetLineOut.writeString("# service=" + service + "\n");
        packetLineOut.end();
        PacketLineOutRefAdvertiser packetLineOutRefAdvertiser = new PacketLineOutRefAdvertiser(packetLineOut);

        if (service.equals("git-upload-pack")) {
            Repository repository = GitRepository.buildGitRepository(project);
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

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.