@Override public RequestToken getOAuthRequestToken(String callbackURL, String xAuthAccessType, String xAuthMode) throws TwitterException { if (oauthToken instanceof AccessToken) { throw new IllegalStateException("Access token already available."); } List<HttpParameter> params = new ArrayList<HttpParameter>(); if (callbackURL != null) { params.add(new HttpParameter("oauth_callback", callbackURL)); } if (xAuthAccessType != null) { params.add(new HttpParameter("x_auth_access_type", xAuthAccessType)); } if (xAuthMode != null) { params.add(new HttpParameter("x_auth_mode", xAuthMode)); } oauthToken = new RequestToken(http.post(conf.getOAuthRequestTokenURL(), params.toArray(new HttpParameter[params.size()]), this, null), this); return (RequestToken) oauthToken; }