@Override public Repository open(Object req, String name) throws RepositoryNotFoundException { throw new RepositoryNotFoundException(name); } };
/** * Constructs an exception indicating a local repository does not exist. * * @param location * description of the repository not found, usually file path. */ public RepositoryNotFoundException(String location) { super(message(location)); }
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; } }
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; } }
@Override public Repository open(boolean mustExist) throws IOException { if (mustExist && !isGitRepository(path, fs)) throw new RepositoryNotFoundException(path); return new FileRepository(path); }
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; } }
/** * Constructs an exception indicating a local repository does not exist. * * @param location * description of the repository not found, usually file path. * @param why * why the repository does not exist. */ public RepositoryNotFoundException(String location, Throwable why) { super(message(location), why); }
throws RepositoryNotFoundException, ServiceNotEnabledException { if (isUnreasonableName(name)) throw new RepositoryNotFoundException(name); db = RepositoryCache.open(key, true); } catch (IOException e) { throw new RepositoryNotFoundException(name, e); throw new RepositoryNotFoundException(name, e); throw new RepositoryNotFoundException(name, e); throw new RepositoryNotFoundException(name, new RepositoryNotFoundException(dir)); throw new RepositoryNotFoundException(name);
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; } }
/** * Constructs an exception indicating a local repository does not exist. * * @param location * description of the repository not found, usually file path. * @param why * why the repository does not exist. */ public RepositoryNotFoundException(String location, Throwable why) { super(message(location), why); }
/** * {@inheritDoc} * <p> * Create a repository matching the configuration in this builder. * <p> * If an option was not set, the build method will try to default the option * based on other options. If insufficient information is available, an * exception is thrown to the caller. * * @since 3.0 */ @Override public Repository build() throws IOException { FileRepository repo = new FileRepository(setup()); if (isMustExist() && !repo.getObjectDatabase().exists()) throw new RepositoryNotFoundException(getGitDir()); return repo; }
/** * Constructs an exception indicating a local repository does not exist. * * @param location * description of the repository not found, usually file path. */ public RepositoryNotFoundException(final String location) { super(message(location)); }
/** * Create a repository matching the configuration in this builder. * <p> * If an option was not set, the build method will try to default the option * based on other options. If insufficient information is available, an * exception is thrown to the caller. * * @return a repository matching this configuration. The caller is * responsible to close the repository instance when it is no longer * needed. * @throws java.lang.IllegalArgumentException * insufficient parameters were set. * @throws java.io.IOException * the repository could not be accessed to configure the rest of * the builder's parameters. */ @SuppressWarnings({ "unchecked", "resource" }) public R build() throws IOException { R repo = (R) new FileRepository(setup()); if (isMustExist() && !repo.getObjectDatabase().exists()) throw new RepositoryNotFoundException(getGitDir()); return repo; }
/** * Constructs an exception indicating a local repository does not exist. * * @param location * description of the repository not found, usually file path. * @param why * why the repository does not exist. */ public RepositoryNotFoundException(String location, Throwable why) { super(message(location), why); }
public Repository open(Object req, String name) throws RepositoryNotFoundException { throw new RepositoryNotFoundException(name); } };
/** * Constructs an exception indicating a local repository does not exist. * * @param location * description of the repository not found, usually file path. */ public RepositoryNotFoundException(String location) { super(message(location)); }
@Override public Repository open(Object req, String name) throws RepositoryNotFoundException { throw new RepositoryNotFoundException(name); } };
public Repository open(HttpServletRequest req, String name) throws RepositoryNotFoundException, ServiceNotEnabledException { if (!name.equals(nameOf(db))) throw new RepositoryNotFoundException(name); db.incrementOpen(); return db; } });
@Override public Repository open(HttpServletRequest req, String name) throws RepositoryNotFoundException, ServiceNotEnabledException { if (!name.equals(nameOf(db))) throw new RepositoryNotFoundException(name); db.incrementOpen(); return db; } });
@Override public Repository open( final DaemonClient client, final String name ) throws RepositoryNotFoundException, ServiceNotAuthorizedException, ServiceNotEnabledException, ServiceMayNotContinueException { final JGitFileSystem fs = fileSystems.get( name ); if ( fs == null ) { throw new RepositoryNotFoundException( name ); } return fs.gitRepo().getRepository(); } }