Example usage for twitter4j HttpResponseCode FORBIDDEN

List of usage examples for twitter4j HttpResponseCode FORBIDDEN

Introduction

In this page you can find the example usage for twitter4j HttpResponseCode FORBIDDEN.

Prototype

int FORBIDDEN

To view the source code for twitter4j HttpResponseCode FORBIDDEN.

Click Source Link

Usage

From source file:com.rhymestore.twitter.util.TwitterUtils.java

License:Open Source License

/**
 * Checks if the exception cause is a duplicate tweet.
 * //from  w  ww. j  ava  2  s . c o  m
 * @param ex The exception to check.
 * @return Boolean indicating if the exception cause is a duplicate tweet.
 */
public static boolean isDuplicateTweetError(final TwitterException ex) {
    return ex.getStatusCode() == HttpResponseCode.FORBIDDEN && ex.getMessage().contains(DUPLICATE_TWEET_ERROR);
}