Package org.eclipse.jgit.errors

Examples of org.eclipse.jgit.errors.TransportException


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


          // complete copy of the messages (if any) buffered from
          // the other data channels.
          //
          int b = in.read();
          if (0 <= b)
            throw new TransportException(uri, MessageFormat.format(JGitText.get().expectedEOFReceived, (char) b));
        }
      }
    } catch (TransportException e) {
      throw e;
    } catch (Exception e) {
      throw new TransportException(uri, e.getMessage(), e);
    } finally {
      close();
    }
  }
View Full Code Here

      return new JschSession(session, uri);

    } catch (JSchException je) {
      final Throwable c = je.getCause();
      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, je.getMessage(), je);
    }

  }
View Full Code Here

    } finally {
      try {
      for (final PackLock lock : packLocks)
        lock.unlock();
      } catch (IOException e) {
        throw new TransportException(e.getMessage(), e);
      }
    }
  }
View Full Code Here

    try {
      result.setAdvertisedRefs(transport.getURI(), conn.getRefsMap());
      final Set<Ref> matched = new HashSet<Ref>();
      for (final RefSpec spec : toFetch) {
        if (spec.getSource() == null)
          throw new TransportException(MessageFormat.format(
              JGitText.get().sourceRefNotSpecifiedForRefspec, spec));

        if (spec.isWildcard())
          expandWildcard(spec, matched);
        else
          expandSingle(spec, matched);
      }

      Collection<Ref> additionalTags = Collections.<Ref> emptyList();
      final TagOpt tagopt = transport.getTagOpt();
      if (tagopt == TagOpt.AUTO_FOLLOW)
        additionalTags = expandAutoFollowTags();
      else if (tagopt == TagOpt.FETCH_TAGS)
        expandFetchTags();

      final boolean includedTags;
      if (!askFor.isEmpty() && !askForIsComplete()) {
        fetchObjects(monitor);
        includedTags = conn.didFetchIncludeTags();

        // Connection was used for object transfer. If we
        // do another fetch we must open a new connection.
        //
        closeConnection(result);
      } else {
        includedTags = false;
      }

      if (tagopt == TagOpt.AUTO_FOLLOW && !additionalTags.isEmpty()) {
        // There are more tags that we want to follow, but
        // not all were asked for on the initial request.
        //
        have.addAll(askFor.keySet());
        askFor.clear();
        for (final Ref r : additionalTags) {
          ObjectId id = r.getPeeledObjectId();
          if (id == null)
            id = r.getObjectId();
          if (transport.local.hasObject(id))
            wantTag(r);
        }

        if (!askFor.isEmpty() && (!includedTags || !askForIsComplete())) {
          reopenConnection();
          if (!askFor.isEmpty())
            fetchObjects(monitor);
        }
      }
    } finally {
      closeConnection(result);
    }

    final RevWalk walk = new RevWalk(transport.local);
    try {
      if (monitor instanceof BatchingProgressMonitor) {
        ((BatchingProgressMonitor) monitor).setDelayStart(
            250, TimeUnit.MILLISECONDS);
      }
      monitor.beginTask(JGitText.get().updatingReferences, localUpdates.size());
      if (transport.isRemoveDeletedRefs())
        deleteStaleTrackingRefs(result, walk);
      for (TrackingRefUpdate u : localUpdates) {
        try {
          monitor.update(1);
          u.update(walk);
          result.add(u);
        } catch (IOException err) {
          throw new TransportException(MessageFormat.format(JGitText
              .get().failureUpdatingTrackingRef,
              u.getLocalName(), err.getMessage()), err);
        }
      }
      monitor.endTask();
    } finally {
      walk.release();
    }

    if (!fetchHeadUpdates.isEmpty()) {
      try {
        updateFETCH_HEAD(result);
      } catch (IOException err) {
        throw new TransportException(MessageFormat.format(
            JGitText.get().failureUpdatingFETCH_HEAD, err.getMessage()), err);
      }
    }
  }
View Full Code Here

    } finally {
      packLocks.addAll(conn.getPackLocks());
    }
    if (transport.isCheckFetchedObjects()
        && !conn.didFetchTestConnectivity() && !askForIsComplete())
      throw new TransportException(transport.getURI(),
          JGitText.get().peerDidNotSupplyACompleteObjectGraph);
  }
View Full Code Here

      }
      return true;
    } catch (MissingObjectException e) {
      return false;
    } catch (IOException e) {
      throw new TransportException(JGitText.get().unableToCheckConnectivity, e);
    }
  }
View Full Code Here

  private void expandSingle(final RefSpec spec, final Set<Ref> matched)
      throws TransportException {
    final Ref src = conn.getRef(spec.getSource());
    if (src == null) {
      throw new TransportException(MessageFormat.format(JGitText.get().remoteDoesNotHaveSpec, spec.getSource()));
    }
    if (matched.add(src))
      want(src, spec);
  }
View Full Code Here

          return;
        localUpdates.add(tru);
      } catch (IOException err) {
        // Bad symbolic ref? That is the most likely cause.
        //
        throw new TransportException( MessageFormat.format(
            JGitText.get().cannotResolveLocalTrackingRefForUpdating, spec.getDestination()), err);
      }
    }

    askFor.put(newId, src);
View Full Code Here

      case NO_CHANGE:
      case FAST_FORWARD:
      case FORCED:
        break;
      default:
        throw new TransportException(transport.getURI(), MessageFormat.format(
            JGitText.get().cannotDeleteStaleTrackingRef2, name, u.getResult().name()));
      }
    } catch (IOException e) {
      throw new TransportException(transport.getURI(), MessageFormat.format(
          JGitText.get().cannotDeleteStaleTrackingRef, name), e);
    }
  }
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.