/** * Get current human. * @return Human * @throws IOException If fails */ protected final Human human() throws IOException { final Identity identity = this.auth().identity(); if (identity.equals(Identity.ANONYMOUS)) { throw this.flash().redirect( this.uriInfo().getBaseUri(), "please login", Level.INFO ); } try { return this.base().human(identity.urn()); } catch (final Base.HumanNotFoundException ex) { throw new WebApplicationException( ex, Response.seeOther(this.uriInfo().getBaseUri()) .cookie(this.auth().logout()) .entity(ex.getLocalizedMessage()) .build() ); } }
.replaceQuery("") .build() ).cookie(this.logout()).build(), String.format( "redirecting because of '%s' flag in HTTP query",