public Resolution doWithCredential(String userId,Callable<Resolution> action){
  Credential credential=loadCredential(userId);
  if (credential != null) {
    try {
      return action.call();
    }
 catch (    Exception e) {
      throw new RuntimeException(e);
    }
  }
  return new RedirectResolution(computeAuthorizationUrl());
}

public Resolution doWithCredential ( String userId , Callable < Resolution > action ) { Credential credential = loadCredential ( userId ) ; if ( credential != null ) { try { return action . call ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } return new RedirectResolution ( computeAuthorizationUrl ( ) ) ; }
executes an action if the user ' s credential is known , otherwise redirects to the authorization page .
