Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.PacketLineOut


     */
    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);
            UploadPack uploadPack = new UploadPack(repository);
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

  }

  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, true);
    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

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.