/** * {@inheritDoc} */ @Override public <T> T create(final String user, final String password) throws CredentialNotFoundException { if (lock.isValid(user, password)) { @SuppressWarnings("unchecked") final T hash = (T) (new Date().getTime() + "abc"); REPOSITORY.put(hash, user); return hash; } else { throw new CredentialNotFoundException(); } }
/** * Gets the text of a deleted page (it's like getPageText, but for deleted * pages). * @param page a page * @return the deleted text * @throws IOException if a network error occurs * @throws CredentialNotFoundException if we cannot obtain deleted revisions * @since 0.30 */ public String getDeletedText(String page) throws IOException, CredentialNotFoundException { if (!user.isAllowedTo("deletedhistory") || !user.isAllowedTo("deletedtext")) throw new CredentialNotFoundException("Permission denied: not able to view deleted history or text."); // TODO: this can be multiquery(?) StringBuilder url = new StringBuilder(query); url.append("list=deletedrevs&drlimit=1&drprop=content&titles="); url.append(URLEncoder.encode(page, "UTF-8")); // expected form: <rev timestamp="2009-04-05T22:40:35Z" xml:space="preserve">TEXT OF PAGE</rev> String line = fetch(url.toString(), "getDeletedText"); int a = line.indexOf("<rev "); a = line.indexOf(">", a) + 1; int b = line.indexOf("</rev>", a); return line.substring(a, b); }
public UUID login(String realmName, String username, String password) throws LoginException { if (defaultRealm == null) { throw new LoginException("No Tomcat realm available"); } final Principal principal = defaultRealm.authenticate(username, password); if (principal == null) throw new CredentialNotFoundException(username); Subject subject = createSubject(defaultRealm, principal); UUID token = registerSubject(subject); return token; }
throw new CredentialNotFoundException("Not logged in"); StringBuilder url = new StringBuilder(query); url.append("list=watchlist&wlprop=ids%7Ctitle%7Ctimestamp%7Cuser%7Ccomment%7Csizes&wllimit=max");
public UUID login(final String realmName, final String username, final String password) throws LoginException { final Realm realm = findRealm(realmName); if (realm == null) { throw new LoginException("No Tomcat realm available"); } final Principal principal = realm.authenticate(username, password); if (principal == null) { throw new CredentialNotFoundException(username); } final Subject subject = createSubject(realm, principal); return registerSubject(subject); }
throw new CredentialNotFoundException("Permission denied: not able to view deleted history or text.");
throw new CredentialNotFoundException("User does not have the \"unwatchedpages\" permission.");
throw new CredentialNotFoundException("Permission denied: not able to view deleted history");
throw new CredentialNotFoundException("The watchlist is available for registered users only.");
throw new CredentialNotFoundException("Cannot protect: permission denied.");
throw new CredentialNotFoundException("Permission denied: not able to view deleted history");
throw new CredentialNotFoundException("Permission denied: cannot revision delete.");
private static AmazonWebServicesCredentials lookupNamedCredential(String credentialsId) throws CredentialNotFoundException { List<AmazonWebServicesCredentials> credentialList = CredentialsProvider.lookupCredentials( AmazonWebServicesCredentials.class, Jenkins.get(), ACL.SYSTEM, Collections.<DomainRequirement>emptyList()); AmazonWebServicesCredentials cred = CredentialsMatchers.firstOrNull(credentialList, CredentialsMatchers.allOf( CredentialsMatchers.withId(credentialsId))); if (cred == null) { throw new CredentialNotFoundException(credentialsId); } return cred; }
throw new CredentialNotFoundException("Cannot delete: Permission denied");
throw new CredentialNotFoundException("Permission denied: cannot email.");
throw new CredentialNotFoundException("Permission denied."); // session expired or stupidity
CredentialNotFoundException ex = new CredentialNotFoundException("Permission denied: cannot upload files."); log(Level.SEVERE, "upload", "Cannot upload - permission denied." + ex); throw ex;
CredentialNotFoundException ex = new CredentialNotFoundException("Permission denied: cannot move pages."); log(Level.SEVERE, "move", "Cannot move - permission denied: " + ex); throw ex;
throw new CredentialNotFoundException("Cannot undelete: Permission denied");
throw new CredentialNotFoundException("Cannot unblock: permission denied!");