/** Get a Principal matching the user. * If there is no user realm, and therefore we are using a * htpassword file instead, then just return a dummy Principal. * @param user * @param realm * @return */ public Principal getPrincipal (String user, UserRealm realm) { if (realm==null) return new DummyPrincipal(user); return realm.getPrincipal(user); } /* ------------------------------------------------------------ */