public class TwitterImpl extends java.lang.Object implements Twitter
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
APPEND |
protected Authorization |
auth |
static java.lang.String |
COMMAND |
protected Configuration |
conf |
protected z_T4JInternalFactory |
factory |
static java.lang.String |
FINALIZE |
protected HttpClientWrapper |
http |
protected long |
id |
static java.lang.String |
INIT |
static java.lang.String |
MEDIA |
static java.lang.String |
MEDIA_CATEGORY |
static java.lang.String |
MEDIA_ID |
static java.lang.String |
MEDIA_TYPE |
static java.lang.String |
PARAM_ADDITIONAL_OWNERS |
protected java.lang.String |
screenName |
static java.lang.String |
SEGMENT_INDEX |
static java.lang.String |
STATUS |
static java.lang.String |
TOTAL_BYTES |
| Constructor and Description |
|---|
TwitterImpl(Configuration conf,
Authorization auth) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRateLimitStatusListener(RateLimitStatusListener listener)
Registers a RateLimitStatusListener for account associated rate limits
|
Media |
checkVideoUploadStatus(java.lang.String url,
HttpParameter[] parameters) |
User |
createBlock(long userId)
Blocks the user specified in the ID parameter as the authenticating user.
|
User |
createBlock(java.lang.String screenName)
Blocks the user specified in the ID parameter as the authenticating user.
|
java.lang.String |
createVideo(java.lang.String tonVideoLocation,
java.lang.String title,
java.lang.String description) |
java.lang.String |
createVideoImage(java.lang.String tonImageLocation,
java.lang.String title,
java.lang.String description) |
VideoTweetResponse |
createVideoTweet(VideoTweetRequest request) |
protected HttpResponse |
delete(java.lang.String url) |
protected HttpResponse |
delete(java.lang.String url,
HttpParameter[] params) |
User |
destroyBlock(long userId)
Un-blocks the user specified in the ID parameter as the authenticating user.
|
User |
destroyBlock(java.lang.String screen_name)
Un-blocks the user specified in the ID parameter as the authenticating user.
|
Status |
destroyStatus(long statusId)
Destroys the status specified by the required ID parameter.
Usage note: The authenticating user must be the author of the specified status. |
protected void |
ensureAuthorizationEnabled() |
protected void |
ensureOAuthEnabled() |
boolean |
equals(java.lang.Object o) |
protected HttpResponse |
executeRequest(java.lang.String url,
HttpParameter[] params,
HttpVerb httpVerb) |
protected HttpResponse |
executeRequest(java.lang.String url,
HttpVerb httpVerb) |
protected User |
fillInIDAndScreenName() |
protected HttpResponse |
get(java.lang.String url) |
protected HttpResponse |
get(java.lang.String url,
HttpParameter[] params) |
AccountSettings |
getAccountSettings()
Returns the current trend, geo, language, timezone and sleep time information for the authenticating user.
|
Authorization |
getAuthorization()
Returns the authorization scheme for this instance.
The returned type will be either of BasicAuthorization, OAuthAuthorization, or NullAuthorization |
PagableResponseList<User> |
getBlocksList()
Returns a list of user objects that the authenticating user is blocking.
|
PagableResponseList<User> |
getBlocksList(long cursor)
Returns a list of user objects that the authenticating user is blocking.
|
Configuration |
getConfiguration()
Returns the configuration associated with this instance
|
ResponseList<User> |
getContributees(long userId)
Returns an array of users that the specified user can contribute to.
|
ResponseList<User> |
getContributees(java.lang.String screenName)
Returns an array of users that the specified user can contribute to.
|
ResponseList<User> |
getContributors(long userId)
Returns an array of users who can contribute to the specified account.
|
ResponseList<User> |
getContributors(java.lang.String screenName)
Returns an array of users who can contribute to the specified account.
|
long |
getId()
Returns authenticating user's user id.
This method may internally call verifyCredentials() on the first invocation if - this instance is authenticated by Basic and email address is supplied instead of screen name, or - this instance is authenticated by OAuth. |
AccessToken |
getOAuthAccessToken()
Returns an access token associated with this instance.
If no access token is associated with this instance, this will retrieve a new access token. |
AccessToken |
getOAuthAccessToken(RequestToken requestToken)
Retrieves an access token associated with the supplied request token and sets userId.
|
AccessToken |
getOAuthAccessToken(RequestToken requestToken,
java.lang.String oauthVerifier)
Retrieves an access token associated with the supplied request token and sets userId.
|
AccessToken |
getOAuthAccessToken(java.lang.String oauthVerifier)
Retrieves an access token.
|
AccessToken |
getOAuthAccessToken(java.lang.String screenName,
java.lang.String password)
Retrieves an access token associated with the supplied screen name and password using xAuth.
In order to get access acquire AccessToken using xAuth, you must apply by sending an email to api@twitter.com - all other applications will receive an HTTP 401 error. |
RequestToken |
getOAuthRequestToken()
Retrieves a request token
|
RequestToken |
getOAuthRequestToken(java.lang.String callbackUrl)
Retrieves a request token
|
RequestToken |
getOAuthRequestToken(java.lang.String callbackUrl,
java.lang.String xAuthAccessType)
Retrieves a request token
|
RelatedResults |
getRelatedResults(long statusId)
If available, returns an array of replies and mentions related to the specified Tweet.
|
ResponseList<Status> |
getRetweets(long statusId)
Returns up to 100 of the first retweets of a given tweet.
|
ResponseList<Status> |
getRetweetsOfMe() |
ResponseList<Status> |
getRetweetsOfMe(Paging paging) |
ResponseList<Status> |
getScopedTimeLine(long userId,
Paging paging) |
java.lang.String |
getScreenName()
Returns authenticating user's screen name.
This method may internally call verifyCredentials() on the first invocation if - this instance is authenticated by Basic and email address is supplied instead of screen name, or - this instance is authenticated by OAuth. Note that this method returns a transiently cached (will be lost upon serialization) screen name while it is possible to change a user's screen name. |
protected HttpResponse |
getWithoutMergingImplicitParams(java.lang.String url,
HttpParameter[] params) |
int |
hashCode() |
void |
httpResponseReceived(HttpResponseEvent event) |
ResponseList<Status> |
lookupStatuses(long[] statusIds)
Returns fully-hydrated tweet objects for up to 100 tweets per request, as specified by comma-separated values passed to the id parameter.
|
ResponseList<User> |
lookupUsers(long[] ids)
Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two.
|
ResponseList<User> |
lookupUsers(java.lang.String[] screenNames)
Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two.
|
Media |
mediaUploadInitOrFinalize(java.lang.String url,
HttpParameter[] parameters) |
protected HttpParameter[] |
mergeImplicitParams(HttpParameter[] params) |
protected HttpParameter[] |
mergeParameters(HttpParameter[] params1,
HttpParameter params2) |
protected HttpParameter[] |
mergeParameters(HttpParameter[] params1,
HttpParameter[] params2) |
protected HttpResponse |
post(java.lang.String url) |
protected HttpResponse |
post(java.lang.String url,
HttpParameter[] params) |
protected HttpResponse |
post(java.lang.String url,
java.lang.String requestBody) |
HttpResponse |
postBatchRequest(java.lang.String url,
java.lang.String requestBody) |
protected HttpResponse |
postWithCustomHeaders(java.lang.String url,
HttpParameter[] params,
java.util.Map<java.lang.String,java.lang.String> customHeaders,
boolean isTonUpload) |
protected HttpResponse |
put(java.lang.String url) |
protected HttpResponse |
put(java.lang.String url,
HttpParameter[] params) |
protected HttpResponse |
putWithCustomHeaders(java.lang.String url,
HttpParameter[] params,
java.util.Map<java.lang.String,java.lang.String> customHeaders,
boolean isTonUpload) |
void |
removeProfileBanner()
Removes the uploaded profile banner for the authenticating user.
|
Status |
retweetStatus(long statusId)
Retweets a tweet.
|
ResponseList<User> |
searchUsers(java.lang.String query,
int page)
Run a search for users similar to the Find People button on Twitter.com; the same results returned by people search on Twitter.com will be returned by using this API.
Usage note: It is only possible to retrieve the first 1000 matches from this API. |
protected void |
setFactory() |
void |
setOAuthAccessToken(AccessToken accessToken)
Sets the access token
|
void |
setOAuthConsumer(java.lang.String consumerKey,
java.lang.String consumerSecret)
sets the OAuth consumer key and consumer secret
|
Status |
showStatus(long id)
Returns a single status, specified by the id parameter below.
|
User |
showUser(long userId)
Returns extended information of a given user, specified by ID or screen name as per the required id parameter.
|
User |
showUser(java.lang.String screenName)
Returns extended information of a given user, specified by ID or screen name as per the required id parameter.
|
void |
shutdown()
Shuts down this instance and releases allocated resources.
|
java.lang.String |
toString() |
AccountSettings |
updateAccountSettings(java.lang.Integer trend_locationWoeid,
java.lang.Boolean sleep_timeEnabled,
java.lang.String start_sleepTime,
java.lang.String end_sleepTime,
java.lang.String time_zone,
java.lang.String lang)
Updates the current trend, geo, language, timezone and sleep time information for the authenticating user.
|
User |
updateProfile(java.lang.String name,
java.lang.String url,
java.lang.String location,
java.lang.String description)
Sets values that users are able to set under the "Account" tab of their settings page.
|
User |
updateProfileBackgroundImage(java.io.File image,
boolean tile)
Updates the authenticating user's profile background image.
|
User |
updateProfileBackgroundImage(java.io.InputStream image,
boolean tile)
Updates the authenticating user's profile background image.
|
void |
updateProfileBanner(java.io.File image)
Uploads a profile banner on behalf of the authenticating user.
|
void |
updateProfileBanner(java.io.InputStream image)
Uploads a profile banner on behalf of the authenticating user.
|
User |
updateProfileColors(java.lang.String profileBackgroundColor,
java.lang.String profileTextColor,
java.lang.String profileLinkColor,
java.lang.String profileSidebarFillColor,
java.lang.String profileSidebarBorderColor)
Sets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com.
|
User |
updateProfileImage(java.io.File image)
Updates the authenticating user's profile image.
|
User |
updateProfileImage(java.io.InputStream image)
Updates the authenticating user's profile image.
|
Status |
updateStatus(StatusUpdate status)
Updates the authenticating user's status.
|
Status |
updateStatus(java.lang.String status)
Updates the authenticating user's status.
|
Media |
upload(MediaUpload mediaUpload) |
java.lang.String |
uploadMediaInChunks(java.lang.String filePath,
long fileSize,
java.lang.String mediaType,
java.lang.String mediaCategory,
int maxChunkSize,
long maxWaitTimeTranscoding,
java.lang.String accountUserId) |
java.lang.String |
uploadToTon(TonUpload tonUpload) |
User |
verifyCredentials()
Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not.
|
protected void |
waitForVideoTranscoding(java.lang.String mediaId,
long maxWaitTime)
upload status :- [pending] -> [in_progress] -> [succeeded | failed]
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetOAuthAccessToken, getOAuthAccessToken, getOAuthAccessToken, getOAuthAccessToken, getOAuthAccessToken, getOAuthRequestToken, getOAuthRequestToken, getOAuthRequestToken, setOAuthAccessToken, setOAuthConsumeraddRateLimitStatusListener, getAuthorization, getConfiguration, getId, getScreenName, shutdowncreateVideo, createVideoImage, createVideoTweet, upload, uploadToTonpublic static final java.lang.String COMMAND
public static final java.lang.String MEDIA_ID
public static final java.lang.String SEGMENT_INDEX
public static final java.lang.String MEDIA
public static final java.lang.String MEDIA_TYPE
public static final java.lang.String MEDIA_CATEGORY
public static final java.lang.String PARAM_ADDITIONAL_OWNERS
public static final java.lang.String TOTAL_BYTES
public static final java.lang.String INIT
public static final java.lang.String APPEND
public static final java.lang.String FINALIZE
public static final java.lang.String STATUS
protected Configuration conf
protected transient java.lang.String screenName
protected transient long id
protected transient HttpClientWrapper http
protected z_T4JInternalFactory factory
protected Authorization auth
public TwitterImpl(Configuration conf, Authorization auth)
public ResponseList<Status> getRetweetsOfMe() throws TwitterException
TwitterExceptionpublic ResponseList<Status> getRetweetsOfMe(Paging paging) throws TwitterException
TwitterExceptionpublic ResponseList<Status> getScopedTimeLine(long userId, Paging paging) throws TwitterException
TwitterExceptionpublic ResponseList<Status> getRetweets(long statusId) throws TwitterException
getRetweets in interface TweetsResourcesstatusId - The numerical ID of the tweet you want the retweets of.TwitterException - when Twitter service or network is unavailablepublic Status showStatus(long id) throws TwitterException
showStatus in interface TweetsResourcesid - the numerical ID of the status you're trying to retrieveTwitterExceptionpublic Status destroyStatus(long statusId) throws TwitterException
destroyStatus in interface TweetsResourcesstatusId - The ID of the status to destroy.TwitterException - when Twitter service or network is unavailablepublic Status updateStatus(java.lang.String status) throws TwitterException
updateStatus in interface TweetsResourcesstatus - the text of your status updateTwitterException - when Twitter service or network is unavailablepublic Status updateStatus(StatusUpdate status) throws TwitterException
updateStatus in interface TweetsResourcesstatus - the latest status to be updated.TwitterException - when Twitter service or network is unavailablepublic Status retweetStatus(long statusId) throws TwitterException
retweetStatus in interface TweetsResourcesstatusId - The ID of the status to retweet.TwitterException - when Twitter service or network is unavailablepublic ResponseList<Status> lookupStatuses(long[] statusIds) throws TwitterException
lookupStatuses in interface TweetsResourcesstatusIds - array of the statusIds to statusesLookupTwitterException - when Twitter service or network is unavailablepublic java.lang.String uploadMediaInChunks(java.lang.String filePath,
long fileSize,
java.lang.String mediaType,
java.lang.String mediaCategory,
int maxChunkSize,
long maxWaitTimeTranscoding,
java.lang.String accountUserId)
throws TwitterException
uploadMediaInChunks in interface TweetsResourcesfilePath - temporary filemaxChunkSize - Maximum chunk size allowed for twitter. @return mediaId of the video..TwitterExceptionpublic AccountSettings getAccountSettings() throws TwitterException
getAccountSettings in interface UsersResourcesTwitterException - when Twitter service or network is unavailablepublic User verifyCredentials() throws TwitterException
verifyCredentials in interface UsersResourcesTwitterExceptionpublic AccountSettings updateAccountSettings(java.lang.Integer trend_locationWoeid, java.lang.Boolean sleep_timeEnabled, java.lang.String start_sleepTime, java.lang.String end_sleepTime, java.lang.String time_zone, java.lang.String lang) throws TwitterException
updateAccountSettings in interface UsersResourcestrend_locationWoeid - Optional. The Yahoo! Where On Earth ID to use as the user's default trend location.sleep_timeEnabled - Optional. Whether sleep time is enabled for the userstart_sleepTime - Optional. The hour that sleep time should begin if it is enabled.end_sleepTime - Optional. The hour that sleep time should end if it is enabled.time_zone - Optional. The timezone dates and times should be displayed in for the user.lang - Optional. The language which Twitter should render in for this user. (two letter ISO 639-1)TwitterException - when Twitter service or network is unavailablepublic User updateProfile(java.lang.String name, java.lang.String url, java.lang.String location, java.lang.String description) throws TwitterException
updateProfile in interface UsersResourcesname - Optional. Maximum of 20 characters.url - Optional. Maximum of 100 characters. Will be prepended with "http://" if not present.location - Optional. Maximum of 30 characters. The contents are not normalized or geocoded in any way.description - Optional. Maximum of 160 characters.TwitterException - when Twitter service or network is unavailablepublic User updateProfileBackgroundImage(java.io.File image, boolean tile) throws TwitterException
updateProfileBackgroundImage in interface UsersResourcesimage - Must be a valid GIF, JPG, or PNG image of less than 800 kilobytes in size. Images with width larger than 2048 pixels will be forceably scaled down.tile - If set to true the background image will be displayed tiled. The image will not be tiled otherwise.TwitterException - when Twitter service or network is unavailable,
or when the specified file is not found (FileNotFoundException will be nested),
or when the specified file object in not representing a file (IOException will be nested)public User updateProfileBackgroundImage(java.io.InputStream image, boolean tile) throws TwitterException
updateProfileBackgroundImage in interface UsersResourcesimage - Must be a valid GIF, JPG, or PNG image of less than 800 kilobytes in size. Images with width larger than 2048 pixels will be forceably scaled down.tile - If set to true the background image will be displayed tiled. The image will not be tiled otherwise.TwitterException - when Twitter service or network is unavailable,
or when the specified file is not found (FileNotFoundException will be nested),
or when the specified file object in not representing a file (IOException will be nested)public User updateProfileColors(java.lang.String profileBackgroundColor, java.lang.String profileTextColor, java.lang.String profileLinkColor, java.lang.String profileSidebarFillColor, java.lang.String profileSidebarBorderColor) throws TwitterException
updateProfileColors in interface UsersResourcesprofileBackgroundColor - optional, can be nullprofileTextColor - optional, can be nullprofileLinkColor - optional, can be nullprofileSidebarFillColor - optional, can be nullprofileSidebarBorderColor - optional, can be nullTwitterException - when Twitter service or network is unavailablepublic User updateProfileImage(java.io.File image) throws TwitterException
updateProfileImage in interface UsersResourcesimage - Must be a valid GIF, JPG, or PNG image of less than 700 kilobytes in size. Images with width larger than 500 pixels will be scaled down.TwitterException - when Twitter service or network is unavailable,
or when the specified file is not found (FileNotFoundException will be nested),
or when the specified file object in not representing a file (IOException will be nested)public User updateProfileImage(java.io.InputStream image) throws TwitterException
updateProfileImage in interface UsersResourcesimage - Must be a valid GIF, JPG, or PNG image of less than 700 kilobytes in size. Images with width larger than 500 pixels will be scaled down.TwitterException - when Twitter service or network is unavailable,
or when the specified file is not found (FileNotFoundException will be nested),
or when the specified file object in not representing a file (IOException will be nested)public PagableResponseList<User> getBlocksList() throws TwitterException
getBlocksList in interface UsersResourcesTwitterException - when Twitter service or network is unavailablepublic PagableResponseList<User> getBlocksList(long cursor) throws TwitterException
getBlocksList in interface UsersResourcescursor - Causes the list of blocked users to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor is provided, a value of -1 will be assumed, which is the first "page."TwitterException - when Twitter service or network is unavailablepublic User createBlock(long userId) throws TwitterException
createBlock in interface UsersResourcesuserId - the ID of the user to blockTwitterException - when Twitter service or network is unavailablepublic User createBlock(java.lang.String screenName) throws TwitterException
createBlock in interface UsersResourcesscreenName - the screen_name of the user to blockTwitterException - when Twitter service or network is unavailablepublic User destroyBlock(long userId) throws TwitterException
destroyBlock in interface UsersResourcesuserId - the ID of the user to blockTwitterException - when Twitter service or network is unavailablepublic User destroyBlock(java.lang.String screen_name) throws TwitterException
destroyBlock in interface UsersResourcesscreen_name - the screen_name of the user to blockTwitterException - when Twitter service or network is unavailablepublic ResponseList<User> lookupUsers(long[] ids) throws TwitterException
lookupUsers in interface UsersResourcesids - Specifies the screen names of the users to return.TwitterException - when Twitter service or network is unavailablepublic ResponseList<User> lookupUsers(java.lang.String[] screenNames) throws TwitterException
lookupUsers in interface UsersResourcesscreenNames - Specifies the screen names of the users to return.TwitterException - when Twitter service or network is unavailablepublic User showUser(long userId) throws TwitterException
showUser in interface UsersResourcesuserId - the ID of the user for whom to request the detailTwitterException - when Twitter service or network is unavailablepublic User showUser(java.lang.String screenName) throws TwitterException
showUser in interface UsersResourcesscreenName - the screen name of the user for whom to request the detailTwitterException - when Twitter service or network is unavailablepublic ResponseList<User> searchUsers(java.lang.String query, int page) throws TwitterException
searchUsers in interface UsersResourcesquery - The query to run against people search.page - Specifies the page of results to retrieve. Number of statuses per page is fixed to 20.TwitterException - when Twitter service or network is unavailablepublic ResponseList<User> getContributees(long userId) throws TwitterException
getContributees in interface UsersResourcesuserId - The user id of the user for whom to return results forTwitterException - when Twitter service or network is unavailablepublic ResponseList<User> getContributees(java.lang.String screenName) throws TwitterException
getContributees in interface UsersResourcesscreenName - The screen name of the user for whom to return results forTwitterException - when Twitter service or network is unavailablepublic ResponseList<User> getContributors(long userId) throws TwitterException
getContributors in interface UsersResourcesuserId - The user id of the user for whom to return results forTwitterException - when Twitter service or network is unavailablepublic ResponseList<User> getContributors(java.lang.String screenName) throws TwitterException
getContributors in interface UsersResourcesscreenName - The screen name of the user for whom to return results forTwitterException - when Twitter service or network is unavailablepublic void removeProfileBanner()
throws TwitterException
removeProfileBanner in interface UsersResourcesTwitterExceptionpublic void updateProfileBanner(java.io.File image)
throws TwitterException
updateProfileBanner in interface UsersResourcesimage - For best results, upload an <5MB image that is exactly 1252px by 626px.TwitterException - when Twitter service or network is unavailable,
or when the specified file is not found (FileNotFoundException will be nested),
or when the specified file object in not representing a file (IOException will be nested)public void updateProfileBanner(java.io.InputStream image)
throws TwitterException
updateProfileBanner in interface UsersResourcesimage - For best results, upload an <5MB image that is exactly 1252px by 626px.TwitterException - when Twitter service or network is unavailable,
or when the specified file is not found (FileNotFoundException will be nested),
or when the specified file object in not representing a file (IOException will be nested)public RelatedResults getRelatedResults(long statusId) throws TwitterException
UndocumentedResourcesgetRelatedResults in interface UndocumentedResourcesstatusId - the numerical ID of the status you're trying to retrieveTwitterExceptionprotected void waitForVideoTranscoding(java.lang.String mediaId,
long maxWaitTime)
throws TwitterException
TwitterExceptionpublic java.lang.String toString()
toString in class java.lang.Objectprotected void setFactory()
public java.lang.String getScreenName()
throws TwitterException,
java.lang.IllegalStateException
getScreenName in interface TwitterBaseTwitterException - when verifyCredentials threw an exception.java.lang.IllegalStateException - if no credentials are supplied. i.e.) this is an anonymous Twitter instancepublic long getId()
throws TwitterException,
java.lang.IllegalStateException
getId in interface TwitterBaseTwitterException - when verifyCredentials threw an exception.java.lang.IllegalStateException - if no credentials are supplied. i.e.) this is an anonymous Twitter instanceprotected User fillInIDAndScreenName() throws TwitterException
TwitterExceptionpublic void addRateLimitStatusListener(RateLimitStatusListener listener)
addRateLimitStatusListener in interface TwitterBaselistener - the listener to be addedpublic void httpResponseReceived(HttpResponseEvent event)
httpResponseReceived in interface HttpResponseListenerpublic final Authorization getAuthorization()
getAuthorization in interface TwitterBasepublic Configuration getConfiguration()
getConfiguration in interface TwitterBasepublic void shutdown()
shutdown in interface TwitterBaseprotected final void ensureAuthorizationEnabled()
protected final void ensureOAuthEnabled()
public void setOAuthConsumer(java.lang.String consumerKey,
java.lang.String consumerSecret)
setOAuthConsumer in interface OAuthSupportconsumerKey - OAuth consumer keyconsumerSecret - OAuth consumer secretpublic RequestToken getOAuthRequestToken() throws TwitterException
getOAuthRequestToken in interface OAuthSupportTwitterException - when Twitter service or network is unavailablepublic RequestToken getOAuthRequestToken(java.lang.String callbackUrl) throws TwitterException
getOAuthRequestToken in interface OAuthSupportcallbackUrl - callback URLTwitterException - when Twitter service or network is unavailablepublic RequestToken getOAuthRequestToken(java.lang.String callbackUrl, java.lang.String xAuthAccessType) throws TwitterException
getOAuthRequestToken in interface OAuthSupportcallbackUrl - callback URLxAuthAccessType - Overrides the access level an application requests to a users account. Supported values are read or write. This parameter is intended to allow a developer to register a read/write application but also request read only access when appropriate.TwitterException - when Twitter service or network is unavailablepublic AccessToken getOAuthAccessToken() throws TwitterException
getOAuthAccessToken in interface OAuthSupportTwitterException - When Twitter service or network is unavailable, when the user has not authorized, or when the client application is not permitted to use xAuthpublic AccessToken getOAuthAccessToken(java.lang.String oauthVerifier) throws TwitterException
getOAuthAccessToken in interface OAuthSupportoauthVerifier - OAuth verifier. AKA pin.java.lang.IllegalStateException - when AccessToken has already been retrieved or setTwitterException - when Twitter service or network is unavailable, or the user has not authorizedpublic AccessToken getOAuthAccessToken(RequestToken requestToken) throws TwitterException
getOAuthAccessToken in interface OAuthSupportrequestToken - the request tokenjava.lang.IllegalStateException - when AccessToken has already been retrieved or setTwitterException - when Twitter service or network is unavailable, or the user has not authorizedpublic AccessToken getOAuthAccessToken(RequestToken requestToken, java.lang.String oauthVerifier) throws TwitterException
getOAuthAccessToken in interface OAuthSupportrequestToken - the request tokenoauthVerifier - OAuth verifier. AKA pin.java.lang.IllegalStateException - when AccessToken has already been retrieved or setTwitterException - when Twitter service or network is unavailable, or the user has not authorizedpublic void setOAuthAccessToken(AccessToken accessToken)
setOAuthAccessToken in interface OAuthSupportaccessToken - accessTokenpublic AccessToken getOAuthAccessToken(java.lang.String screenName, java.lang.String password) throws TwitterException
getOAuthAccessToken in interface OAuthSupportscreenName - the screen namepassword - the passwordTwitterException - when Twitter service or network is unavailable, or the user has not authorizedpublic Media upload(MediaUpload mediaUpload) throws TwitterException
TwitterExceptionpublic Media mediaUploadInitOrFinalize(java.lang.String url, HttpParameter[] parameters) throws TwitterException
TwitterExceptionpublic Media checkVideoUploadStatus(java.lang.String url, HttpParameter[] parameters) throws TwitterException
TwitterExceptionpublic java.lang.String createVideo(java.lang.String tonVideoLocation,
java.lang.String title,
java.lang.String description)
throws TwitterException
TwitterExceptionpublic java.lang.String createVideoImage(java.lang.String tonImageLocation,
java.lang.String title,
java.lang.String description)
throws TwitterException
TwitterExceptionpublic VideoTweetResponse createVideoTweet(VideoTweetRequest request) throws TwitterException
TwitterExceptionpublic java.lang.String uploadToTon(TonUpload tonUpload) throws TwitterException
TwitterExceptionpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectprotected HttpResponse executeRequest(java.lang.String url, HttpVerb httpVerb) throws TwitterException
TwitterExceptionprotected HttpResponse executeRequest(java.lang.String url, HttpParameter[] params, HttpVerb httpVerb) throws TwitterException
TwitterExceptionprotected HttpResponse get(java.lang.String url) throws TwitterException
TwitterExceptionprotected HttpResponse getWithoutMergingImplicitParams(java.lang.String url, HttpParameter[] params) throws TwitterException
TwitterExceptionprotected HttpResponse get(java.lang.String url, HttpParameter[] params) throws TwitterException
TwitterExceptionprotected HttpResponse post(java.lang.String url) throws TwitterException
TwitterExceptionprotected HttpResponse post(java.lang.String url, HttpParameter[] params) throws TwitterException
TwitterExceptionprotected HttpResponse post(java.lang.String url, java.lang.String requestBody) throws TwitterException
TwitterExceptionprotected HttpResponse postWithCustomHeaders(java.lang.String url, HttpParameter[] params, java.util.Map<java.lang.String,java.lang.String> customHeaders, boolean isTonUpload) throws TwitterException
TwitterExceptionprotected HttpResponse putWithCustomHeaders(java.lang.String url, HttpParameter[] params, java.util.Map<java.lang.String,java.lang.String> customHeaders, boolean isTonUpload) throws TwitterException
TwitterExceptionprotected HttpResponse put(java.lang.String url) throws TwitterException
TwitterExceptionpublic HttpResponse postBatchRequest(java.lang.String url, java.lang.String requestBody) throws TwitterException
TwitterExceptionprotected HttpResponse put(java.lang.String url, HttpParameter[] params) throws TwitterException
TwitterExceptionprotected HttpResponse delete(java.lang.String url) throws TwitterException
TwitterExceptionprotected HttpResponse delete(java.lang.String url, HttpParameter[] params) throws TwitterException
TwitterExceptionprotected HttpParameter[] mergeParameters(HttpParameter[] params1, HttpParameter[] params2)
protected HttpParameter[] mergeParameters(HttpParameter[] params1, HttpParameter params2)
protected HttpParameter[] mergeImplicitParams(HttpParameter[] params)