Package org.eclipse.jgit.errors

Examples of org.eclipse.jgit.errors.RepositoryNotFoundException


            .setDatabase(db)
            .setRepositoryName(name)
            .setMustExist(true)
            .build();
        } catch (DhtException e) {
          throw new RepositoryNotFoundException(name, e);
        }
      }
    };

    d.setPackConfig(packConfig);
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 open(final C req, final String name)
      throws RepositoryNotFoundException, ServiceNotEnabledException {
    if (isUnreasonableName(name))
      throw new RepositoryNotFoundException(name);

    Repository db = exports.get(nameWithDotGit(name));
    if (db != null) {
      db.incrementOpen();
      return db;
    }

    for (File base : exportBase) {
      File dir = FileKey.resolve(new File(base, name), FS.DETECTED);
      if (dir == null)
        continue;

      try {
        FileKey key = FileKey.exact(dir, FS.DETECTED);
        db = RepositoryCache.open(key, true);
      } catch (IOException e) {
        throw new RepositoryNotFoundException(name, e);
      }

      try {
        if (isExportOk(req, name, db)) {
          // We have to leak the open count to the caller, they
          // are responsible for closing the repository if we
          // complete successfully.
          return db;
        } else
          throw new ServiceNotEnabledException();

      } catch (RuntimeException e) {
        db.close();
        throw new RepositoryNotFoundException(name, e);

      } catch (IOException e) {
        db.close();
        throw new RepositoryNotFoundException(name, e);

      } catch (ServiceNotEnabledException e) {
        db.close();
        throw e;
      }
    }

    if (exportBase.size() == 1) {
      File dir = new File(exportBase.iterator().next(), name);
      throw new RepositoryNotFoundException(name,
          new RepositoryNotFoundException(dir));
    }

    throw new RepositoryNotFoundException(name);
  }
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

            gitRepositoryManager.ensureRepository(pluginKey);
            return resolver.open(req, pluginKey);
        }
        else
        {
            throw new RepositoryNotFoundException(name);
        }
    }
View Full Code Here

      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

      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

  }

  public Repository open(final C req, final String name)
      throws RepositoryNotFoundException, ServiceNotEnabledException {
    if (isUnreasonableName(name))
      throw new RepositoryNotFoundException(name);

    Repository db = exports.get(nameWithDotGit(name));
    if (db != null) {
      db.incrementOpen();
      return db;
    }

    for (File base : exportBase) {
      File dir = FileKey.resolve(new File(base, name), FS.DETECTED);
      if (dir == null)
        continue;

      try {
        FileKey key = FileKey.exact(dir, FS.DETECTED);
        db = RepositoryCache.open(key, true);
      } catch (IOException e) {
        throw new RepositoryNotFoundException(name, e);
      }

      try {
        if (isExportOk(req, name, db)) {
          // We have to leak the open count to the caller, they
          // are responsible for closing the repository if we
          // complete successfully.
          return db;
        } else
          throw new ServiceNotEnabledException();

      } catch (RuntimeException e) {
        db.close();
        throw new RepositoryNotFoundException(name, e);

      } catch (IOException e) {
        db.close();
        throw new RepositoryNotFoundException(name, e);

      } catch (ServiceNotEnabledException e) {
        db.close();
        throw e;
      }
    }

    if (exportBase.size() == 1) {
      File dir = new File(exportBase.iterator().next(), name);
      throw new RepositoryNotFoundException(name,
          new RepositoryNotFoundException(dir));
    }

    throw new RepositoryNotFoundException(name);
  }
View Full Code Here

    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

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.