Package org.eclipse.jgit.errors

Examples of org.eclipse.jgit.errors.RepositoryNotFoundException


      return path;
    }

    public Repository open(final boolean mustExist) throws IOException {
      if (mustExist && !isGitRepository(path, fs))
        throw new RepositoryNotFoundException(path);
      return new FileRepository(path);
    }
View Full Code Here


   */
  @SuppressWarnings("unchecked")
  public R build() throws IOException {
    R repo = (R) new FileRepository(setup());
    if (isMustExist() && !repo.getObjectDatabase().exists())
      throw new RepositoryNotFoundException(getGitDir());
    return repo;
  }
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  public R build() throws IOException {
    R repo = (R) new FileRepository(setup());
    if (isMustExist() && !repo.getObjectDatabase().exists())
      throw new RepositoryNotFoundException(getGitDir());
    return repo;
  }
View Full Code Here

  }

  public Repository openRepository(String name)
      throws RepositoryNotFoundException {
    if (isUnreasonableName(name)) {
      throw new RepositoryNotFoundException("Invalid name: " + name);
    }

    try {
      final FileKey loc = FileKey.lenient(gitDirOf(name), FS.DETECTED);
      return RepositoryCache.open(loc);
    } catch (IOException e1) {
      final RepositoryNotFoundException e2;
      e2 = new RepositoryNotFoundException("Cannot open repository " + name);
      e2.initCause(e1);
      throw e2;
    }
  }
View Full Code Here

  }

  public Repository createRepository(String name)
      throws RepositoryNotFoundException {
    if (isUnreasonableName(name)) {
      throw new RepositoryNotFoundException("Invalid name: " + name);
    }

    try {
      File dir = FileKey.resolve(gitDirOf(name), FS.DETECTED);
      FileKey loc;
      if (dir != null) {
        // Already exists on disk, use the repository we found.
        //
        loc = FileKey.exact(dir, FS.DETECTED);
      } else {
        // It doesn't exist under any of the standard permutations
        // of the repository name, so prefer the standard bare name.
        //
        if (!name.endsWith(Constants.DOT_GIT_EXT)) {
          name = name + Constants.DOT_GIT_EXT;
        }
        loc = FileKey.exact(new File(basePath, name), FS.DETECTED);
      }
      return RepositoryCache.open(loc, false);
    } catch (IOException e1) {
      final RepositoryNotFoundException e2;
      e2 = new RepositoryNotFoundException("Cannot open repository " + name);
      e2.initCause(e1);
      throw e2;
    }
  }
View Full Code Here

                throws RepositoryNotFoundException,
                ServiceNotAuthorizedException, ServiceNotEnabledException,
                ServiceMayNotContinueException {
            final JGitFileSystem fs = fileSystems.get( name );
            if ( fs == null ) {
                throw new RepositoryNotFoundException( name );
            }
            return fs.gitRepo().getRepository();
        }
View Full Code Here

TOP

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

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.