/** * Create an exception to indicate problems finding a remote repository. The * caller is expected to throw the returned exception. * * Subclasses may override this method to provide better diagnostics. * * @return a TransportException saying a repository cannot be found and * possibly why. */ protected TransportException noRepository() { return new NoRemoteRepositoryException(uri, JGitText.get().notFound); }
BadRepositoryException bre = new BadRepositoryException( ((org.eclipse.jgit.errors.NoRemoteRepositoryException) cause) .getLocalizedMessage()); bre.initCause(e); throw bre;
private NoRemoteRepositoryException createNotFoundException(URIish u, URL url, String msg) { String text; if (msg != null && !msg.isEmpty()) { text = MessageFormat.format(JGitText.get().uriNotFoundWithMessage, url, msg); } else { text = MessageFormat.format(JGitText.get().uriNotFound, url); } return new NoRemoteRepositoryException(u, text); }
NoRemoteRepositoryException cleanNotFound(NoRemoteRepositoryException nf, String why) { if (why == null || why.length() == 0) return nf; String path = uri.getPath(); if (uri.getScheme() != null && uri.getPath().startsWith("/~")) //$NON-NLS-1$ path = uri.getPath().substring(1); final StringBuilder pfx = new StringBuilder(); pfx.append("fatal: "); //$NON-NLS-1$ pfx.append(QuotedString.BOURNE.quote(path)); pfx.append(": "); //$NON-NLS-1$ if (why.startsWith(pfx.toString())) why = why.substring(pfx.length()); return new NoRemoteRepositoryException(uri, why); }
@Override public Transport open(URIish uri) throws NotSupportedException, TransportException { File path = FS.DETECTED.resolve(new File("."), uri.getPath()); //$NON-NLS-1$ // If the reference is to a local file, C Git behavior says // assume this is a bundle, since repositories are directories. if (path.isFile()) return new TransportBundleFile(uri, path); File gitDir = RepositoryCache.FileKey.resolve(path, FS.DETECTED); if (gitDir == null) throw new NoRemoteRepositoryException(uri, JGitText.get().notFound); return new TransportLocal(uri, gitDir); } };
@Override public Transport open(URIish uri, Repository local, String remoteName) throws NoRemoteRepositoryException { File localPath = local.isBare() ? local.getDirectory() : local.getWorkTree(); File path = local.getFS().resolve(localPath, uri.getPath()); // If the reference is to a local file, C Git behavior says // assume this is a bundle, since repositories are directories. if (path.isFile()) return new TransportBundleFile(local, uri, path); File gitDir = RepositoryCache.FileKey.resolve(path, local.getFS()); if (gitDir == null) throw new NoRemoteRepositoryException(uri, JGitText.get().notFound); return new TransportLocal(local, uri, gitDir); }
/** * Create an exception to indicate problems finding a remote repository. The * caller is expected to throw the returned exception. * * Subclasses may override this method to provide better diagnostics. * * @return a TransportException saying a repository cannot be found and * possibly why. */ protected TransportException noRepository() { return new NoRemoteRepositoryException(uri, JGitText.get().notFound); }
/** * Create an exception to indicate problems finding a remote repository. The * caller is expected to throw the returned exception. * * Subclasses may override this method to provide better diagnostics. * * @return a TransportException saying a repository cannot be found and * possibly why. */ protected TransportException noRepository() { return new NoRemoteRepositoryException(uri, JGitText.get().notFound); }
private NoRemoteRepositoryException createNotFoundException(URIish u, URL url, String msg) { String text; if (msg != null && !msg.isEmpty()) { text = MessageFormat.format(JGitText.get().uriNotFoundWithMessage, url, msg); } else { text = MessageFormat.format(JGitText.get().uriNotFound, url); } return new NoRemoteRepositoryException(u, text); }
NoRemoteRepositoryException cleanNotFound(NoRemoteRepositoryException nf, String why) { if (why == null || why.length() == 0) return nf; String path = uri.getPath(); if (uri.getScheme() != null && uri.getPath().startsWith("/~")) //$NON-NLS-1$ path = uri.getPath().substring(1); final StringBuilder pfx = new StringBuilder(); pfx.append("fatal: "); //$NON-NLS-1$ pfx.append(QuotedString.BOURNE.quote(path)); pfx.append(": "); //$NON-NLS-1$ if (why.startsWith(pfx.toString())) why = why.substring(pfx.length()); return new NoRemoteRepositoryException(uri, why); }
NoRemoteRepositoryException cleanNotFound(NoRemoteRepositoryException nf, String why) { if (why == null || why.length() == 0) return nf; String path = uri.getPath(); if (uri.getScheme() != null && uri.getPath().startsWith("/~")) //$NON-NLS-1$ path = uri.getPath().substring(1); final StringBuilder pfx = new StringBuilder(); pfx.append("fatal: "); //$NON-NLS-1$ pfx.append(QuotedString.BOURNE.quote(path)); pfx.append(": "); //$NON-NLS-1$ if (why.startsWith(pfx.toString())) why = why.substring(pfx.length()); return new NoRemoteRepositoryException(uri, why); }
public Transport open(URIish uri) throws NotSupportedException, TransportException { File path = FS.DETECTED.resolve(new File("."), uri.getPath()); //$NON-NLS-1$ // If the reference is to a local file, C Git behavior says // assume this is a bundle, since repositories are directories. if (path.isFile()) return new TransportBundleFile(uri, path); File gitDir = RepositoryCache.FileKey.resolve(path, FS.DETECTED); if (gitDir == null) throw new NoRemoteRepositoryException(uri, JGitText.get().notFound); return new TransportLocal(uri, gitDir); } };
@Override public Transport open(URIish uri) throws NotSupportedException, TransportException { File path = FS.DETECTED.resolve(new File("."), uri.getPath()); //$NON-NLS-1$ // If the reference is to a local file, C Git behavior says // assume this is a bundle, since repositories are directories. if (path.isFile()) return new TransportBundleFile(uri, path); File gitDir = RepositoryCache.FileKey.resolve(path, FS.DETECTED); if (gitDir == null) throw new NoRemoteRepositoryException(uri, JGitText.get().notFound); return new TransportLocal(uri, gitDir); } };
throw new NoRemoteRepositoryException(uri, JGitText.get().notFound);
throw new NoRemoteRepositoryException(uri, MessageFormat.format(JGitText.get().uriNotFound, u));
@Override public Transport open(URIish uri, Repository local, String remoteName) throws NoRemoteRepositoryException { File localPath = local.isBare() ? local.getDirectory() : local.getWorkTree(); File path = local.getFS().resolve(localPath, uri.getPath()); // If the reference is to a local file, C Git behavior says // assume this is a bundle, since repositories are directories. if (path.isFile()) return new TransportBundleFile(local, uri, path); File gitDir = RepositoryCache.FileKey.resolve(path, local.getFS()); if (gitDir == null) throw new NoRemoteRepositoryException(uri, JGitText.get().notFound); return new TransportLocal(local, uri, gitDir); }
@Override public Transport open(URIish uri, Repository local, String remoteName) throws NoRemoteRepositoryException { File localPath = local.isBare() ? local.getDirectory() : local.getWorkTree(); File path = local.getFS().resolve(localPath, uri.getPath()); // If the reference is to a local file, C Git behavior says // assume this is a bundle, since repositories are directories. if (path.isFile()) return new TransportBundleFile(local, uri, path); File gitDir = RepositoryCache.FileKey.resolve(path, local.getFS()); if (gitDir == null) throw new NoRemoteRepositoryException(uri, JGitText.get().notFound); return new TransportLocal(local, uri, gitDir); }