/** * Remove a credential with realm and name. * * @param realm The credential realm. * @param name The username. * @return The removed credential, or null if not found. */ public Password remove(String realm, String name) { return super.remove(String.format("%s:%s:", realm, name)); }
/** * {@inheritDoc} */ public Index remove(String key) { if (this.service.versionCompare("5.0") < 0) { throw new UnsupportedOperationException( "Indexes cannot be deleted via the REST API in versions " + "prior to 5.0"); } else { return (Index)super.remove(key); } } }
@Override public Password remove(String key) { // Make it compatible with the old way (low-efficient) if (!key.contains(":")) { Password password = getByUsername((String) key); validate(); if (password == null) return null; password.remove(); // by invalidating any access to items will get refreshed invalidate(); return password; } return super.remove(key); }