/** * Ask for the credential items to be populated with the passphrase. * * @param uri * the URI of the remote resource that needs authentication. * @param items * the items the application requires to complete authentication. * @return {@code true} if the request was successful and values were * supplied; {@code false} if the user canceled the request and did * not supply all requested values. * @throws UnsupportedCredentialItem * if one of the items supplied is not supported. */ @Override public boolean get(URIish uri, CredentialItem... items) throws UnsupportedCredentialItem { for (final CredentialItem item : items) { if (item instanceof CredentialItem.StringType && item.getPromptText().startsWith(PROMPT)) { ((CredentialItem.StringType) item).setValue(passphrase); continue; } throw new UnsupportedCredentialItem(uri, item.getClass().getName() + ":" + item.getPromptText()); } return true; } }
@Override public Repository open(Object req, String name) throws RepositoryNotFoundException { throw new RepositoryNotFoundException(name); } };
/** * Create a large object exception, naming the object that is too big. * * @param id * identity of the object that is too big to be loaded as a byte * array in this JVM. */ public LargeObjectException(AnyObjectId id) { setObjectId(id); }
/** {@inheritDoc} */ @Override public byte[] getCachedBytes() throws LargeObjectException { throw new LargeObjectException(); }
/** * 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); }
@Override protected void limitExceeded() throws TooLargePackException { throw new TooLargePackException(limit); } };
/** * Constructs an ObjectWritingException with the specified detail message. * * @param s message * @param cause root cause exception */ public ObjectWritingException(String s, Throwable cause) { super(s); initCause(cause); } }
/** * Create a large object exception, where the object isn't known. * * @param cause * the cause * @since 4.10 */ public LargeObjectException(Throwable cause) { initCause(cause); }
/** * Construct a wrapper around the original OutOfMemoryError. * * @param cause * the original root cause. */ public OutOfMemory(OutOfMemoryError cause) { initCause(cause); }
/** * Create exception with bytes of the invalid object id. * * @param bytes containing the invalid id. * @param offset in the byte array where the error occurred. * @param length of the sequence of invalid bytes. */ public InvalidObjectIdException(byte[] bytes, int offset, int length) { super(msg(bytes, offset, length)); }
/** * Constructs an IndexWriteException with the specified detail message. * * @param s message * @param cause root cause exception */ public IndexWriteException(String s, Throwable cause) { super(s); initCause(cause); } }
/** * Construct a NotSupportedException for some issue JGit cannot yet handle. * * @param s * message describing the issue * @param why * a lower level implementation specific issue. */ public NotSupportedException(String s, Throwable why) { super(s); initCause(why); } }
/** * Constructs an IndexReadException with the specified detail message. * * @param s * message * @param cause * root cause exception */ public IndexReadException(String s, Throwable cause) { super(s); initCause(cause); } }
/** * Constructs an PackProtocolException with the specified detail message. * * @param s * message, which may be shown to an end-user. * @param cause * root cause exception */ public PackProtocolException(String s, Throwable cause) { super(s); initCause(cause); } }
/** * Constructs an TransportException with the specified detail message. * * @param s * message * @param cause * root cause exception */ public TransportException(String s, Throwable cause) { super(s); initCause(cause); } }
return delegate.get(uri, unprocessedItems.toArray(new CredentialItem[0])); throw new UnsupportedCredentialItem(uri, unprocessedItems.size() + " credential items not supported");
@Override public byte[] getCachedBytes() throws LargeObjectException { throw new LargeObjectException(); } };
/** * 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)); }
continue; throw new UnsupportedCredentialItem(uri, i.getClass().getName() + ":" + i.getPromptText()); //$NON-NLS-1$
@Override public byte[] getCachedBytes() throws LargeObjectException { throw new LargeObjectException(id); }