/** * Creates a Facebook API client with the given <a * href="http://developers.facebook.com/docs/guides/upgrade#oauth">OAuth * access token</a>. * * @param accessToken An OAuth access token. * @param webRequestor The {@link WebRequestor} implementation to use for {@code POST}ing * to the API endpoint. * @param jsonMapper The {@link JsonMapper} implementation to use for mapping API * response JSON to Java objects. * @throws NullPointerException If any parameter is {@code null}. * @throws IllegalArgumentException If {@code accessToken} is a blank string. * @since 1.5 */ public DefaultLegacyFacebookClient(String accessToken, WebRequestor webRequestor, JsonMapper jsonMapper) { verifyParameterPresence("accessToken", accessToken); verifyParameterPresence("webRequestor", webRequestor); verifyParameterPresence("jsonMapper", jsonMapper); this.accessToken = accessToken.trim(); this.webRequestor = webRequestor; this.jsonMapper = jsonMapper; initializeIllegalParamNames(); }
/** * Creates a Facebook API client with the given API key, secret key, * {@code webRequestor}, and {@code jsonMapper} (Legacy authentication). * * @param apiKey A Facebook API key. * @param secretKey A Facebook application secret key. * @param webRequestor The {@link WebRequestor} implementation to use for {@code POST}ing * to the API endpoint. * @param jsonMapper The {@link JsonMapper} implementation to use for mapping API * response JSON to Java objects. * @throws NullPointerException If any parameter is {@code null}. * @throws IllegalArgumentException If either {@code apiKey} or {@code secretKey} is a blank string. * @deprecated You should use * {@link #DefaultLegacyFacebookClient(String, WebRequestor, JsonMapper)} * instead. Facebook is moving to OAuth and will stop supporting * the old authentication scheme soon. */ @Deprecated public DefaultLegacyFacebookClient(String apiKey, String secretKey, WebRequestor webRequestor, JsonMapper jsonMapper) { verifyParameterPresence("apiKey", apiKey); verifyParameterPresence("secretKey", secretKey); verifyParameterPresence("webRequestor", webRequestor); verifyParameterPresence("jsonMapper", jsonMapper); this.apiKey = apiKey.trim(); this.secretKey = secretKey.trim(); this.webRequestor = webRequestor; this.jsonMapper = jsonMapper; initializeIllegalParamNames(); }