Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.URIish


  private ExecutorService executorService;

  public CassandraRepositoryBuilder setURI(final String url)
      throws URISyntaxException {
    URIish u = new URIish(url);
    if (!"git+cassandra".equals(u.getScheme()))
      throw new IllegalArgumentException();

    String host = u.getHost();
    if (host != null) {
      int port = u.getPort();
      if (port == -1)
        port = 9160;
      setHosts(host + ":" + port);
    }

    String path = u.getPath();
    if (path.startsWith("/"))
      path = path.substring(1);

    int endCluster = path.indexOf('/');
    int endKeyspace = path.indexOf('/', endCluster + 1);
View Full Code Here


  private ExecutorService executorService;

  public CassandraDatabaseBuilder setURI(final String url)
      throws URISyntaxException {
    URIish u = new URIish(url);
    if (!"git+cassandra".equals(u.getScheme()))
      throw new IllegalArgumentException();

    String host = u.getHost();
    if (host != null) {
      int port = u.getPort();
      if (port == -1)
        port = 9160;
      setHosts(host + ":" + port);
    }

    String path = u.getPath();
    if (path.startsWith("/"))
      path = path.substring(1);

    int endCluster = path.indexOf('/');
    int endKeyspace = path.indexOf('/', endCluster + 1);
View Full Code Here

   *             if the repository can't be created
   * @return the newly created {@code Git} object with associated repository
   */
  public Git call() throws JGitInternalException {
    try {
      URIish u = new URIish(uri);
      Repository repository = init(u);
      FetchResult result = fetch(repository, u);
      if (!noCheckout)
        checkout(repository, result);
      return new Git(repository);
View Full Code Here

   public void run(File projectDir, String sourceUri) throws IOException
   {
      try
      {
         final URIish uri = new URIish(sourceUri);
         File gitdir = new File(projectDir, Constants.DOT_GIT);
         db = new FileRepository(gitdir);
         db.create();
         final FileBasedConfig dstcfg = db.getConfig();
         dstcfg.setBoolean("core", null, "bare", false);
View Full Code Here

   *             if the repository can't be created
   * @return the newly created {@code Git} object with associated repository
   */
  public Git call() throws JGitInternalException {
    try {
      URIish u = new URIish(uri);
      Repository repository = init(u);
      FetchResult result = fetch(repository, u);
      if (!noCheckout)
        checkout(repository, result);
      return new Git(repository);
View Full Code Here

  @Override
  protected void run() throws Exception {
    if (localName != null && gitdir != null)
      throw die(CLIText.get().conflictingUsageOf_git_dir_andArguments);

    final URIish uri = new URIish(sourceUri);
    if (localName == null) {
      try {
        localName = uri.getHumanishName();
      } catch (IllegalArgumentException e) {
        throw die(MessageFormat.format(CLIText.get().cannotGuessLocalNameFrom, sourceUri));
      }
    }
    if (gitdir == null)
View Full Code Here

            e.printStackTrace(listener.error(Messages.GitAPI_Workspace_FailedCleanupMsg()));
            throw new GitException(Messages.GitAPI_Workspace_FailedDeleteMsg(), e);
        }

        // Assume only 1 URL for this repository
        final URIish source = remoteConfig.getURIs().get(0);

        try {
            workspace.act(new FilePath.FileCallable<String>() {

                private static final long serialVersionUID = 1L;

                public String invoke(File workspace,
                                     VirtualChannel channel) throws IOException {
                    jGitDelegate = Git.cloneRepository()
                        .setDirectory(workspace.getAbsoluteFile())
                        .setURI(source.toPrivateString())
                        .setRemote(remoteConfig.getName())
                        .call();
                    return Messages.GitAPI_Repository_CloneSuccessMsg(source.toPrivateString(),
                        workspace.getAbsolutePath());
                }
            });
        } catch (Exception e) {
            throw new GitException(Messages.GitAPI_Repository_FailedCloneMsg(source), e);
View Full Code Here

   *             if the repository can't be created
   * @return the newly created {@code Git} object with associated repository
   */
  public Git call() throws JGitInternalException {
    try {
      URIish u = new URIish(uri);
      Repository repository = init(u);
      FetchResult result = fetch(repository, u);
      checkout(repository, result);
      return new Git(repository);
    } catch (IOException ioe) {
View Full Code Here

   *             if the repository can't be created
   * @return the newly created {@code Git} object with associated repository
   */
  public Git call() throws JGitInternalException {
    try {
      URIish u = new URIish(uri);
      Repository repository = init(u);
      FetchResult result = fetch(repository, u);
      checkout(repository, result);
      return new Git(repository);
    } catch (IOException ioe) {
View Full Code Here

        + Constants.DEFAULT_REMOTE_NAME + "/" + Constants.MASTER);
    originMaster.setNewObjectId(commit1);
    originMaster.forceUpdate();
    RemoteConfig config = new RemoteConfig(repo.getConfig(),
        Constants.DEFAULT_REMOTE_NAME);
    config.addURI(new URIish(repo2.toURI().toString()));
    config.update(repo.getConfig());
    Collection<RefDiff> diffs = RepositoryUtils.diffOriginRefs(repo);
    assertNotNull(diffs);
    assertFalse(diffs.isEmpty());
    assertNotNull(diffs.iterator().next().getLocal());
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.transport.URIish

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.