Package org.eclipse.jgit.errors

Examples of org.eclipse.jgit.errors.TransportException


        throws TransportException {
      final Collection<ChannelSftp.LsEntry> list;
      try {
        list = ftp.ls(dir);
      } catch (SftpException je) {
        throw new TransportException("Can't ls " + objectsPath + "/"
            + dir + ": " + je.getMessage(), je);
      }

      for (final ChannelSftp.LsEntry ent : list) {
        final String n = ent.getFilename();
View Full Code Here


          br.close();
        }
      } catch (FileNotFoundException noRef) {
        return null;
      } catch (IOException err) {
        throw new TransportException("Cannot read " + objectsPath + "/"
            + path + ": " + err.getMessage(), err);
      }

      if (line == null)
        throw new TransportException("Empty ref: " + name);

      if (line.startsWith("ref: ")) {
        final String target = line.substring("ref: ".length());
        Ref r = avail.get(target);
        if (r == null)
          r = readRef(avail, ROOT_DIR + target, target);
        if (r == null)
          r = new ObjectIdRef.Unpeeled(Ref.Storage.NEW, target, null);
        r = new SymbolicRef(name, r);
        avail.put(r.getName(), r);
        return r;
      }

      if (ObjectId.isId(line)) {
        final Ref r = new ObjectIdRef.Unpeeled(loose(avail.get(name)),
            name, ObjectId.fromString(line));
        avail.put(r.getName(), r);
        return r;
      }

      throw new TransportException("Bad ref: " + name + ": " + line);
    }
View Full Code Here

    } catch (NotSupportedException err) {
      throw err;
    } catch (TransportException err) {
      throw err;
    } catch (IOException err) {
      throw new TransportException(uri, JGitText.get().errorReadingInfoRefs, err);
    }
  }
View Full Code Here

      case HttpURLConnection.HTTP_NOT_FOUND:
        break;

      default:
        throw new TransportException(uri, MessageFormat.format(
            JGitText.get().cannotReadHEAD, status, conn.getResponseMessage()));
      }
    }

    WalkFetchConnection wfc = new WalkFetchConnection(this, d);
View Full Code Here

    } catch (NotSupportedException err) {
      throw err;
    } catch (TransportException err) {
      throw err;
    } catch (IOException err) {
      throw new TransportException(uri, JGitText.get().errorReadingInfoRefs, err);
    }
  }
View Full Code Here

              MessageFormat.format(JGitText.get().uriNotFound, u));

        case HttpURLConnection.HTTP_UNAUTHORIZED:
          authMethod = HttpAuthMethod.scanResponse(conn);
          if (authMethod == HttpAuthMethod.NONE)
            throw new TransportException(uri, MessageFormat.format(
                JGitText.get().authenticationNotSupported, uri));
          if (1 < authAttempts
              || !authMethod.authorize(uri,
                  getCredentialsProvider())) {
            throw new TransportException(uri,
                JGitText.get().notAuthorized);
          }
          authAttempts++;
          continue;

        case HttpURLConnection.HTTP_FORBIDDEN:
          throw new TransportException(uri, MessageFormat.format(
              JGitText.get().serviceNotPermitted, service));

        default:
          String err = status + " " + conn.getResponseMessage(); //$NON-NLS-1$
          throw new TransportException(uri, err);
        }
      }
    } catch (NotSupportedException e) {
      throw e;
    } catch (TransportException e) {
      throw e;
    } catch (IOException e) {
      throw new TransportException(uri, MessageFormat.format(JGitText.get().cannotOpenService, service), e);
    }
  }
View Full Code Here

    return input;
  }

  IOException wrongContentType(String expType, String actType) {
    final String why = MessageFormat.format(JGitText.get().expectedReceivedContentType, expType, actType);
    return new TransportException(uri, why);
  }
View Full Code Here

    // as a pkt-line stream.
    //
    final byte[] magic = new byte[5];
    IO.readFully(in, magic, 0, magic.length);
    if (magic[4] != '#') {
      throw new TransportException(uri, MessageFormat.format(
          JGitText.get().expectedPktLineWithService, RawParseUtils.decode(magic)));
    }

    final PacketLineIn pckIn = new PacketLineIn(new UnionInputStream(
        new ByteArrayInputStream(magic), in));
    final String exp = "# service=" + service; //$NON-NLS-1$
    final String act = pckIn.readString();
    if (!exp.equals(act)) {
      throw new TransportException(uri, MessageFormat.format(
          JGitText.get().expectedGot, exp, act));
    }

    while (pckIn.readString() != PacketLineIn.END) {
      // for now, ignore the remaining header lines
View Full Code Here

      TransportException {
    if (toFetch == null || toFetch.isEmpty()) {
      // If the caller did not ask for anything use the defaults.
      //
      if (fetch.isEmpty())
        throw new TransportException(JGitText.get().nothingToFetch);
      toFetch = fetch;
    } else if (!fetch.isEmpty()) {
      // If the caller asked for something specific without giving
      // us the local tracking branch see if we can update any of
      // the local tracking branches without incurring additional
View Full Code Here

    if (toPush == null || toPush.isEmpty()) {
      // If the caller did not ask for anything use the defaults.
      try {
        toPush = findRemoteRefUpdatesFor(push);
      } catch (final IOException e) {
        throw new TransportException(MessageFormat.format(
            JGitText.get().problemWithResolvingPushRefSpecsLocally, e.getMessage()), e);
      }
      if (toPush.isEmpty())
        throw new TransportException(JGitText.get().nothingToPush);
    }
    final PushProcess pushProcess = new PushProcess(this, toPush);
    return pushProcess.execute(monitor);
  }
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.