Package org.eclipse.jgit.errors

Examples of org.eclipse.jgit.errors.TransportException


        init(sIn, sOut);
        service("git-receive-pack", pckOut);
      } catch (IOException err) {
        close();
        throw new TransportException(uri,
            JGitText.get().remoteHungUpUnexpectedly, err);
      }
      readAdvertisedRefs();
    }
View Full Code Here


      throws TransportException {
    if (status == 127) {
      IOException cause = null;
      if (why != null && why.length() > 0)
        cause = new IOException(why);
      throw new TransportException(uri, MessageFormat.format(
          JGitText.get().cannotExecute, commandFor(exe)), cause);
    }
  }
View Full Code Here

            local.getDirectory().getPath());

      try {
        return pb.start();
      } catch (IOException err) {
        throw new TransportException(err.getMessage(), err);
      }
    }
View Full Code Here

      } catch (TransportException err) {
        close();
        throw err;
      } catch (IOException err) {
        close();
        throw new TransportException(uri,
            JGitText.get().remoteHungUpUnexpectedly, err);
      }

      try {
        readAdvertisedRefs();
View Full Code Here

      } catch (TransportException err) {
        close();
        throw err;
      } catch (IOException err) {
        close();
        throw new TransportException(uri,
            JGitText.get().remoteHungUpUnexpectedly, err);
      }

      try {
        readAdvertisedRefs();
View Full Code Here

    } catch (CancelledException ce) {
      close();
      return; // Caller should test (or just know) this themselves.
    } catch (IOException err) {
      close();
      throw new TransportException(err.getMessage(), err);
    } catch (RuntimeException err) {
      close();
      throw new TransportException(err.getMessage(), err);
    }
  }
View Full Code Here

        channel = (ChannelExec) sock.openChannel("exec");
        channel.setCommand(commandName);
        setupStreams();
        channel.connect(timeout > 0 ? timeout * 1000 : 0);
        if (!channel.isConnected())
          throw new TransportException(uri, "connection failed");
      } catch (JSchException e) {
        throw new TransportException(uri, e.getMessage(), e);
      }
    }
View Full Code Here

        s.close();
      } catch (IOException closeErr) {
        // ignore a failure during close, we're already failing
      }
      if (c instanceof UnknownHostException)
        throw new TransportException(uri, JGitText.get().unknownHost);
      if (c instanceof ConnectException)
        throw new TransportException(uri, c.getMessage());
      throw new TransportException(uri, c.getMessage(), c);
    }
    return s;
  }
View Full Code Here

      if (conn == null) {
        // Output hasn't started yet, because everything fit into
        // our request buffer. Send with a Content-Length header.
        //
        if (out.length() == 0) {
          throw new TransportException(uri,
              JGitText.get().startingReadStageWithoutWrittenRequestDataPendingIsNotSupported);
        }

        // Try to compress the content, but only if that is smaller.
        TemporaryBuffer buf = new TemporaryBuffer.Heap(http.postBuffer);
        try {
          GZIPOutputStream gzip = new GZIPOutputStream(buf);
          out.writeTo(gzip, null);
          gzip.close();
          if (out.length() < buf.length())
            buf = out;
        } catch (IOException err) {
          // Most likely caused by overflowing the buffer, meaning
          // its larger if it were compressed. Don't compress.
          buf = out;
        }

        openStream();
        if (buf != out)
          conn.setRequestProperty(HDR_CONTENT_ENCODING, ENCODING_GZIP);
        conn.setFixedLengthStreamingMode((int) buf.length());
        final OutputStream httpOut = conn.getOutputStream();
        try {
          buf.writeTo(httpOut, null);
        } finally {
          httpOut.close();
        }
      }

      out.reset();

      final int status = HttpSupport.response(conn);
      if (status != HttpURLConnection.HTTP_OK) {
        throw new TransportException(uri, status + " " //$NON-NLS-1$
            + conn.getResponseMessage());
      }

      final String contentType = conn.getContentType();
      if (!responseType.equals(contentType)) {
View Full Code Here

      //
      return e;
    } catch (TransportException e) {
      // Fall through.
    }
    return new TransportException(uri, JGitText.get().pushNotPermitted);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.errors.TransportException

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.