Examples of RepositoryNotFoundException


Examples of org.eclipse.jgit.errors.RepositoryNotFoundException

    gs.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>() {
      public Repository open(HttpServletRequest req, String name)
          throws RepositoryNotFoundException,
          ServiceNotEnabledException {
        if (!name.equals(srcName))
          throw new RepositoryNotFoundException(name);

        final Repository db = src.getRepository();
        db.incrementOpen();
        return db;
      }
View Full Code Here

Examples of org.eclipse.jgit.errors.RepositoryNotFoundException

    gs.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>() {
      public Repository open(HttpServletRequest req, String name)
          throws RepositoryNotFoundException,
          ServiceNotEnabledException {
        if (!name.equals(srcName))
          throw new RepositoryNotFoundException(name);

        final Repository db = src.getRepository();
        db.incrementOpen();
        return db;
      }
View Full Code Here

Examples of org.eclipse.jgit.errors.RepositoryNotFoundException

    gs.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>() {
      public Repository open(HttpServletRequest req, String name)
          throws RepositoryNotFoundException,
          ServiceNotEnabledException {
        if (!name.equals(nameOf(db)))
          throw new RepositoryNotFoundException(name);

        db.incrementOpen();
        return db;
      }
    });
View Full Code Here

Examples of org.eclipse.jgit.errors.RepositoryNotFoundException

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

Examples of org.eclipse.jgit.errors.RepositoryNotFoundException

      public Repository open(HttpServletRequest req, String name)
          throws RepositoryNotFoundException,
          ServiceNotEnabledException {
        final Repository db = remoteRepository.getRepository();
        if (!name.equals(nameOf(db)))
          throw new RepositoryNotFoundException(name);

        db.incrementOpen();
        return db;
      }
    });
View Full Code Here

Examples of org.eclipse.jgit.errors.RepositoryNotFoundException

    gs.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>() {
      public Repository open(HttpServletRequest req, String name)
          throws RepositoryNotFoundException,
          ServiceNotEnabledException {
        if (!name.equals(srcName))
          throw new RepositoryNotFoundException(name);

        final Repository db = src.getRepository();
        db.incrementOpen();
        return db;
      }
View Full Code Here

Examples of org.eclipse.jgit.errors.RepositoryNotFoundException

    gs.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>() {
      public Repository open(HttpServletRequest req, String name)
          throws RepositoryNotFoundException,
          ServiceNotEnabledException {
        if (!name.equals(srcName))
          throw new RepositoryNotFoundException(name);

        final Repository db = src.getRepository();
        db.incrementOpen();
        return db;
      }
View Full Code Here

Examples of org.eclipse.jgit.errors.RepositoryNotFoundException

      final ProjectControl pc;
      try {
        pc = projectControlFactory.controlFor(new Project.NameKey(projectName));
      } catch (NoSuchProjectException err) {
        throw new RepositoryNotFoundException(projectName);
      }
      if (!pc.isVisible()) {
        if (pc.getCurrentUser() instanceof AnonymousUser) {
          throw new ServiceNotAuthorizedException();
        } else {
          throw new ServiceNotEnabledException();
        }
      }
      req.setAttribute(ATT_CONTROL, pc);

      try {
        return manager.openRepository(pc.getProject().getNameKey());
      } catch (IOException e) {
        throw new RepositoryNotFoundException(
            pc.getProject().getNameKey().get(), e);
      }
    }
View Full Code Here

Examples of org.eclipse.jgit.errors.RepositoryNotFoundException

  }

  public Repository openRepository(Project.NameKey name)
      throws RepositoryNotFoundException {
    if (isUnreasonableName(name)) {
      throw new RepositoryNotFoundException("Invalid name: " + name);
    }
    if (!names.contains(name)) {
      throw new RepositoryNotFoundException(gitDirOf(name));
    }
    final FileKey loc = FileKey.lenient(gitDirOf(name), FS.DETECTED);
    try {
      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

Examples of org.eclipse.jgit.errors.RepositoryNotFoundException

  }

  public Repository createRepository(final Project.NameKey name)
      throws RepositoryNotFoundException, RepositoryCaseMismatchException {
    if (isUnreasonableName(name)) {
      throw new RepositoryNotFoundException("Invalid name: " + name);
    }

    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);

      if (!names.contains(name)) {
        throw new RepositoryCaseMismatchException(name);
      }
    } else {
      // It doesn't exist under any of the standard permutations
      // of the repository name, so prefer the standard bare name.
      //
      String n = name.get();
      if (!n.endsWith(Constants.DOT_GIT_EXT)) {
        n = n + Constants.DOT_GIT_EXT;
      }
      loc = FileKey.exact(new File(basePath, n), FS.DETECTED);
    }

    try {
      Repository db = RepositoryCache.open(loc, false);
      db.create(true /* bare */);

      StoredConfig config = db.getConfig();
      config.setBoolean(ConfigConstants.CONFIG_CORE_SECTION,
        null, ConfigConstants.CONFIG_KEY_LOGALLREFUPDATES, true);
      config.save();

      onCreateProject(name);

      return db;
    } catch (IOException e1) {
      final RepositoryNotFoundException e2;
      e2 = new RepositoryNotFoundException("Cannot create repository " + name);
      e2.initCause(e1);
      throw e2;
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.