diff --git a/settings.gradle b/settings.gradle
index 0d0b807b0..8850e4395 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,6 +1,4 @@
include ':twidere'
-include ':twidere.component.twitter4j'
-//include ':twidere.component.twitter4j.streaming'
include ':twidere.component.common'
include ':twidere.library.extension'
include ':twidere.component.querybuilder'
@@ -8,7 +6,6 @@ include ':twidere.wear'
include ':twidere.donate.nyanwp'
include ':twidere.donate.nyanwp.wear'
include ':twidere.component.nyan'
-//include ':twidere.extension.streaming'
include ':twidere.extension.twitlonger'
include ':twidere.extension.push.xiaomi'
include ':twidere.extension.launcher.compose'
\ No newline at end of file
diff --git a/twidere.component.common/build.gradle b/twidere.component.common/build.gradle
index ef908c120..902b761e2 100644
--- a/twidere.component.common/build.gradle
+++ b/twidere.component.common/build.gradle
@@ -42,6 +42,5 @@ dependencies {
compile 'com.bluelinelabs:logansquare:1.0.6'
compile 'org.apache.commons:commons-lang3:3.4'
compile project(':twidere.component.querybuilder')
- compile project(':twidere.component.twitter4j')
compile fileTree(dir: 'libs', include: ['*.jar'])
}
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/Converter.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/Converter.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/Converter.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/Converter.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/ErrorCallback.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/ErrorCallback.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/ErrorCallback.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/ErrorCallback.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/FileValue.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/FileValue.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/FileValue.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/FileValue.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/RawCallback.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/RawCallback.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/RawCallback.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/RawCallback.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/RestAPIFactory.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/RestAPIFactory.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/RestAPIFactory.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/RestAPIFactory.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/RestCallback.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/RestCallback.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/RestCallback.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/RestCallback.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/RestClient.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/RestClient.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/RestClient.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/RestClient.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/RestException.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/RestException.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/RestException.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/RestException.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/RestMethod.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/RestMethod.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/RestMethod.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/RestMethod.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/RestMethodInfo.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/RestMethodInfo.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/RestMethodInfo.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/RestMethodInfo.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/Utils.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/Utils.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/Utils.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/Utils.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/Authorization.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/Authorization.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/Authorization.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/Authorization.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/BodyType.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/BodyType.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/BodyType.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/BodyType.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/ContentType.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/ContentType.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/ContentType.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/ContentType.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/Endpoint.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/Endpoint.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/Endpoint.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/Endpoint.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/RestHttpClient.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/RestHttpClient.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/RestHttpClient.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/RestHttpClient.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/RestRequest.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/RestRequest.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/RestRequest.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/RestRequest.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/RestResponse.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/RestResponse.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/RestResponse.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/RestResponse.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/SimpleValueMap.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/SimpleValueMap.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/SimpleValueMap.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/SimpleValueMap.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/ValueMap.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/ValueMap.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/ValueMap.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/ValueMap.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/mime/BaseTypedData.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/mime/BaseTypedData.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/mime/BaseTypedData.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/mime/BaseTypedData.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/mime/FileTypedData.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/mime/FileTypedData.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/mime/FileTypedData.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/mime/FileTypedData.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/mime/FormTypedBody.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/mime/FormTypedBody.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/mime/FormTypedBody.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/mime/FormTypedBody.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/mime/MultipartTypedBody.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/mime/MultipartTypedBody.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/mime/MultipartTypedBody.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/mime/MultipartTypedBody.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/mime/TypedData.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/mime/TypedData.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/http/mime/TypedData.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/http/mime/TypedData.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/io/StreamingGZIPInputStream.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/io/StreamingGZIPInputStream.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/io/StreamingGZIPInputStream.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/io/StreamingGZIPInputStream.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/method/GET.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/method/GET.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/method/GET.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/method/GET.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/method/POST.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/method/POST.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/method/POST.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/method/POST.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/param/Body.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/param/Body.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/param/Body.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/param/Body.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/param/Extra.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/param/Extra.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/param/Extra.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/param/Extra.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/param/File.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/param/File.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/param/File.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/param/File.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/param/Form.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/param/Form.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/param/Form.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/param/Form.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/param/Header.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/param/Header.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/param/Header.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/param/Header.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/param/Part.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/param/Part.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/param/Part.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/param/Part.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/param/Path.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/param/Path.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/param/Path.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/param/Path.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/param/Query.java b/twidere.component.common/src/main/java/org/mariotaku/simplerestapi/param/Query.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/simplerestapi/param/Query.java
rename to twidere.component.common/src/main/java/org/mariotaku/simplerestapi/param/Query.java
diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/Twitter.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/Twitter.java
new file mode 100644
index 000000000..85f07b037
--- /dev/null
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/Twitter.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.mariotaku.twidere.api.twitter;
+
+import org.mariotaku.twidere.api.twitter.api.DirectMessagesResources;
+import org.mariotaku.twidere.api.twitter.api.FavoritesResources;
+import org.mariotaku.twidere.api.twitter.api.FriendsFollowersResources;
+import org.mariotaku.twidere.api.twitter.api.HelpResources;
+import org.mariotaku.twidere.api.twitter.api.ListsResources;
+import org.mariotaku.twidere.api.twitter.api.PlacesGeoResources;
+import org.mariotaku.twidere.api.twitter.api.PrivateActivityResources;
+import org.mariotaku.twidere.api.twitter.api.PrivateDirectMessagesResources;
+import org.mariotaku.twidere.api.twitter.api.PrivateFriendsFollowersResources;
+import org.mariotaku.twidere.api.twitter.api.PrivateTimelinesResources;
+import org.mariotaku.twidere.api.twitter.api.PrivateTweetResources;
+import org.mariotaku.twidere.api.twitter.api.SavedSearchesResources;
+import org.mariotaku.twidere.api.twitter.api.SearchResource;
+import org.mariotaku.twidere.api.twitter.api.SpamReportingResources;
+import org.mariotaku.twidere.api.twitter.api.TimelinesResources;
+import org.mariotaku.twidere.api.twitter.api.TrendsResources;
+import org.mariotaku.twidere.api.twitter.api.TweetResources;
+import org.mariotaku.twidere.api.twitter.api.UsersResources;
+
+/**
+ * @author Yusuke Yamamoto - yusuke at mac.com
+ * @since Twitter4J 2.2.0
+ */
+public interface Twitter extends SearchResource, TimelinesResources,
+ TweetResources, UsersResources, ListsResources, DirectMessagesResources, FriendsFollowersResources,
+ FavoritesResources, SpamReportingResources, SavedSearchesResources, TrendsResources, PlacesGeoResources,
+ HelpResources, PrivateActivityResources, PrivateTweetResources, PrivateTimelinesResources,
+ PrivateFriendsFollowersResources, PrivateDirectMessagesResources {
+}
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/TwitterConstants.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/TwitterConstants.java
similarity index 99%
rename from twidere.component.twitter4j/src/main/java/twitter4j/TwitterConstants.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/TwitterConstants.java
index 204b7a3a1..8e4139f1a 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/TwitterConstants.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/TwitterConstants.java
@@ -1,4 +1,4 @@
-package twitter4j;
+package org.mariotaku.twidere.api.twitter;
public interface TwitterConstants {
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/TwitterException.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/TwitterException.java
similarity index 95%
rename from twidere.component.twitter4j/src/main/java/twitter4j/TwitterException.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/TwitterException.java
index 84fa0c5f1..19e7f086b 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/TwitterException.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/TwitterException.java
@@ -17,19 +17,22 @@
* along with this program. If not, see .
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import org.mariotaku.simplerestapi.http.RestRequest;
import org.mariotaku.simplerestapi.http.RestResponse;
+import org.mariotaku.twidere.api.twitter.model.ErrorInfo;
+import org.mariotaku.twidere.api.twitter.model.RateLimitStatus;
+import org.mariotaku.twidere.api.twitter.model.TwitterResponse;
import org.mariotaku.twidere.api.twitter.model.impl.RateLimitStatusJSONImpl;
import java.util.Locale;
-import twitter4j.http.HttpResponseCode;
-import twitter4j.internal.util.InternalParseUtil;
+import org.mariotaku.twidere.api.twitter.http.HttpResponseCode;
+import org.mariotaku.twidere.api.twitter.util.InternalParseUtil;
/**
* An exception class that will be thrown when TwitterAPI calls are failed.
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/TwitterOAuth.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/TwitterOAuth.java
similarity index 97%
rename from twidere.component.twitter4j/src/main/java/twitter4j/TwitterOAuth.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/TwitterOAuth.java
index f034cc5c5..63496bbae 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/TwitterOAuth.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/TwitterOAuth.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter;
import org.mariotaku.simplerestapi.http.BodyType;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/DirectMessagesResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/DirectMessagesResources.java
similarity index 90%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/DirectMessagesResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/DirectMessagesResources.java
index 916b75ecf..ea867b9cd 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/DirectMessagesResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/DirectMessagesResources.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
import org.mariotaku.simplerestapi.http.BodyType;
import org.mariotaku.simplerestapi.method.GET;
@@ -23,10 +23,10 @@ import org.mariotaku.simplerestapi.param.Body;
import org.mariotaku.simplerestapi.param.Form;
import org.mariotaku.simplerestapi.param.Query;
-import twitter4j.DirectMessage;
-import twitter4j.Paging;
-import twitter4j.ResponseList;
-import twitter4j.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.DirectMessage;
+import org.mariotaku.twidere.api.twitter.model.Paging;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
+import org.mariotaku.twidere.api.twitter.TwitterException;
/**
* @author Joern Huxhorn - jhuxhorn at googlemail.com
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/FavoritesResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/FavoritesResources.java
similarity index 89%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/FavoritesResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/FavoritesResources.java
index a476c2632..1bdf7aa69 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/FavoritesResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/FavoritesResources.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
import org.mariotaku.simplerestapi.http.BodyType;
import org.mariotaku.simplerestapi.method.GET;
@@ -26,10 +26,10 @@ import org.mariotaku.simplerestapi.param.Body;
import org.mariotaku.simplerestapi.param.Form;
import org.mariotaku.simplerestapi.param.Query;
-import twitter4j.Paging;
-import twitter4j.ResponseList;
-import twitter4j.Status;
-import twitter4j.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.Paging;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.TwitterException;
/**
* @author Joern Huxhorn - jhuxhorn at googlemail.com
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/FriendsFollowersResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/FriendsFollowersResources.java
similarity index 87%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/FriendsFollowersResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/FriendsFollowersResources.java
index ef5556270..5fda61e8a 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/FriendsFollowersResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/FriendsFollowersResources.java
@@ -17,19 +17,19 @@
* along with this program. If not, see .
*/
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
import org.mariotaku.simplerestapi.method.GET;
import org.mariotaku.simplerestapi.param.Query;
-import twitter4j.Friendship;
-import twitter4j.IDs;
-import twitter4j.PageableResponseList;
-import twitter4j.Paging;
-import twitter4j.Relationship;
-import twitter4j.ResponseList;
-import twitter4j.TwitterException;
-import twitter4j.User;
+import org.mariotaku.twidere.api.twitter.model.Friendship;
+import org.mariotaku.twidere.api.twitter.model.IDs;
+import org.mariotaku.twidere.api.twitter.model.PageableResponseList;
+import org.mariotaku.twidere.api.twitter.model.Paging;
+import org.mariotaku.twidere.api.twitter.model.Relationship;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
+import org.mariotaku.twidere.api.twitter.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.User;
/**
* @author Joern Huxhorn - jhuxhorn at googlemail.com
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/HelpResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/HelpResources.java
similarity index 91%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/HelpResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/HelpResources.java
index dfcfbb4fb..5d0e0bb26 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/HelpResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/HelpResources.java
@@ -17,14 +17,15 @@
* along with this program. If not, see .
*/
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
+
+import org.mariotaku.twidere.api.twitter.TwitterException;
import java.util.Map;
-import twitter4j.RateLimitStatus;
-import twitter4j.ResponseList;
-import twitter4j.TwitterAPIConfiguration;
-import twitter4j.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.RateLimitStatus;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
+import org.mariotaku.twidere.api.twitter.model.TwitterAPIConfiguration;
/**
* @author Joern Huxhorn - jhuxhorn at googlemail.com
@@ -37,7 +38,7 @@ public interface HelpResources {
* they are loaded, but no more than once a day.
*
* @return configuration
- * @throws twitter4j.TwitterException when Twitter service or network is
+ * @throws TwitterException when Twitter service or network is
* unavailable
* @see GET
@@ -52,7 +53,7 @@ public interface HelpResources {
* include lang with any of your requests.
*
* @return list of languages supported by Twitter
- * @throws twitter4j.TwitterException when Twitter service or network is
+ * @throws TwitterException when Twitter service or network is
* unavailable
* @see GET
@@ -66,7 +67,7 @@ public interface HelpResources {
* This method calls http://api.twitter.com/1.1/legal/privacy.json
*
* @return privacy policy
- * @throws twitter4j.TwitterException when Twitter service or network is
+ * @throws TwitterException when Twitter service or network is
* unavailable
* @see GET
* legal/privacy | Twitter Developers
@@ -148,7 +149,7 @@ public interface HelpResources {
* This method calls http://api.twitter.com/1.1/legal/tos.json
*
* @return Terms of Service
- * @throws twitter4j.TwitterException when Twitter service or network is
+ * @throws TwitterException when Twitter service or network is
* unavailable
* @see GET
* legal/tos | Twitter Developers
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/ListsResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/ListsResources.java
similarity index 93%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/ListsResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/ListsResources.java
index 048cea220..5ed610b09 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/ListsResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/ListsResources.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
import org.mariotaku.simplerestapi.http.BodyType;
import org.mariotaku.simplerestapi.method.GET;
@@ -26,14 +26,14 @@ import org.mariotaku.simplerestapi.param.Body;
import org.mariotaku.simplerestapi.param.Form;
import org.mariotaku.simplerestapi.param.Query;
-import twitter4j.PageableResponseList;
-import twitter4j.Paging;
-import twitter4j.ResponseList;
-import twitter4j.Status;
-import twitter4j.TwitterException;
-import twitter4j.User;
-import twitter4j.UserList;
-import twitter4j.UserListUpdate;
+import org.mariotaku.twidere.api.twitter.model.PageableResponseList;
+import org.mariotaku.twidere.api.twitter.model.Paging;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.User;
+import org.mariotaku.twidere.api.twitter.model.UserList;
+import org.mariotaku.twidere.api.twitter.model.UserListUpdate;
/**
* @author Joern Huxhorn - jhuxhorn at googlemail.com
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/PlacesGeoResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PlacesGeoResources.java
similarity index 93%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/PlacesGeoResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PlacesGeoResources.java
index 9b2d40966..685ab0317 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/PlacesGeoResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PlacesGeoResources.java
@@ -17,14 +17,14 @@
* along with this program. If not, see .
*/
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
-import twitter4j.GeoLocation;
-import twitter4j.GeoQuery;
-import twitter4j.Place;
-import twitter4j.ResponseList;
-import twitter4j.SimilarPlaces;
-import twitter4j.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.GeoLocation;
+import org.mariotaku.twidere.api.twitter.model.GeoQuery;
+import org.mariotaku.twidere.api.twitter.model.Place;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
+import org.mariotaku.twidere.api.twitter.model.SimilarPlaces;
+import org.mariotaku.twidere.api.twitter.TwitterException;
/**
* @author Yusuke Yamamoto - yusuke at mac.com
@@ -58,7 +58,7 @@ public interface PlacesGeoResources {
/**
* Find out more details of a place that was returned from the
- * {@link PlacesGeoResources#reverseGeoCode(twitter4j.GeoQuery)}
+ * {@link PlacesGeoResources#reverseGeoCode(GeoQuery)}
* method.
* This method calls http://api.twitter.com/1.1/geo/id/:id.json
*
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/PrivateActivityResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateActivityResources.java
similarity index 60%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/PrivateActivityResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateActivityResources.java
index 09e96c6f5..c7d9d8c5f 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/PrivateActivityResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateActivityResources.java
@@ -1,9 +1,9 @@
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
-import twitter4j.Activity;
-import twitter4j.Paging;
-import twitter4j.ResponseList;
-import twitter4j.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.Activity;
+import org.mariotaku.twidere.api.twitter.model.Paging;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
+import org.mariotaku.twidere.api.twitter.TwitterException;
public interface PrivateActivityResources extends PrivateResources {
public ResponseList getActivitiesAboutMe() throws TwitterException;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/PrivateDirectMessagesResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateDirectMessagesResources.java
similarity index 90%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/PrivateDirectMessagesResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateDirectMessagesResources.java
index f092e4598..24e854cd0 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/PrivateDirectMessagesResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateDirectMessagesResources.java
@@ -17,9 +17,9 @@
* along with this program. If not, see .
*/
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
-import twitter4j.TwitterException;
+import org.mariotaku.twidere.api.twitter.TwitterException;
/**
* Created by mariotaku on 15/1/6.
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/PrivateFriendsFollowersResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateFriendsFollowersResources.java
similarity index 69%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/PrivateFriendsFollowersResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateFriendsFollowersResources.java
index 7d2bed674..604b32e67 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/PrivateFriendsFollowersResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateFriendsFollowersResources.java
@@ -1,7 +1,7 @@
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
-import twitter4j.TwitterException;
-import twitter4j.User;
+import org.mariotaku.twidere.api.twitter.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.User;
public interface PrivateFriendsFollowersResources extends PrivateResources {
diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateResources.java
new file mode 100644
index 000000000..04a80aaa0
--- /dev/null
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateResources.java
@@ -0,0 +1,5 @@
+package org.mariotaku.twidere.api.twitter.api;
+
+public interface PrivateResources {
+
+}
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/PrivateTimelinesResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateTimelinesResources.java
similarity index 80%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/PrivateTimelinesResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateTimelinesResources.java
index 85972241c..37860c9e3 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/PrivateTimelinesResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateTimelinesResources.java
@@ -1,12 +1,12 @@
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
import org.mariotaku.simplerestapi.method.GET;
import org.mariotaku.simplerestapi.param.Query;
-import twitter4j.Paging;
-import twitter4j.ResponseList;
-import twitter4j.Status;
-import twitter4j.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.Paging;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.TwitterException;
public interface PrivateTimelinesResources extends PrivateResources {
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/PrivateTweetResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateTweetResources.java
similarity index 66%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/PrivateTweetResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateTweetResources.java
index b63a8557b..ae81f39a7 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/PrivateTweetResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/PrivateTweetResources.java
@@ -1,14 +1,14 @@
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
import org.mariotaku.simplerestapi.method.GET;
import org.mariotaku.simplerestapi.param.Query;
-import twitter4j.Paging;
-import twitter4j.ResponseList;
-import twitter4j.Status;
-import twitter4j.StatusActivitySummary;
-import twitter4j.TranslationResult;
-import twitter4j.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.Paging;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.model.StatusActivitySummary;
+import org.mariotaku.twidere.api.twitter.model.TranslationResult;
+import org.mariotaku.twidere.api.twitter.TwitterException;
public interface PrivateTweetResources extends PrivateResources {
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/SavedSearchesResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/SavedSearchesResources.java
similarity index 84%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/SavedSearchesResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/SavedSearchesResources.java
index 5c5f88803..de236482d 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/SavedSearchesResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/SavedSearchesResources.java
@@ -17,13 +17,13 @@
* along with this program. If not, see .
*/
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
import org.mariotaku.simplerestapi.method.GET;
-import twitter4j.ResponseList;
-import twitter4j.SavedSearch;
-import twitter4j.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
+import org.mariotaku.twidere.api.twitter.model.SavedSearch;
+import org.mariotaku.twidere.api.twitter.TwitterException;
public interface SavedSearchesResources {
SavedSearch createSavedSearch(String query) throws TwitterException;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/SearchResource.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/SearchResource.java
similarity index 82%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/SearchResource.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/SearchResource.java
index 5d54d0377..e995a7549 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/SearchResource.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/SearchResource.java
@@ -17,14 +17,14 @@
* along with this program. If not, see .
*/
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
import org.mariotaku.simplerestapi.method.GET;
import org.mariotaku.simplerestapi.param.Query;
-import twitter4j.QueryResult;
-import twitter4j.SearchQuery;
-import twitter4j.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.QueryResult;
+import org.mariotaku.twidere.api.twitter.model.SearchQuery;
+import org.mariotaku.twidere.api.twitter.TwitterException;
public interface SearchResource {
@GET("/search/tweets.json")
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/SpamReportingResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/SpamReportingResources.java
similarity index 92%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/SpamReportingResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/SpamReportingResources.java
index 000a6e7b4..bf9bb646f 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/SpamReportingResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/SpamReportingResources.java
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
-import twitter4j.TwitterException;
-import twitter4j.User;
+import org.mariotaku.twidere.api.twitter.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.User;
/**
* @author Joern Huxhorn - jhuxhorn at googlemail.com
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/TimelinesResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/TimelinesResources.java
similarity index 86%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/TimelinesResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/TimelinesResources.java
index c8e948fdb..fd25a80c1 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/TimelinesResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/TimelinesResources.java
@@ -17,15 +17,15 @@
* along with this program. If not, see .
*/
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
import org.mariotaku.simplerestapi.method.GET;
import org.mariotaku.simplerestapi.param.Query;
-import twitter4j.Paging;
-import twitter4j.ResponseList;
-import twitter4j.Status;
-import twitter4j.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.Paging;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.TwitterException;
/**
* @author Joern Huxhorn - jhuxhorn at googlemail.com
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/TrendsResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/TrendsResources.java
similarity index 89%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/TrendsResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/TrendsResources.java
index 07081c951..a11b0bdc0 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/TrendsResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/TrendsResources.java
@@ -14,13 +14,13 @@
* limitations under the License.
*/
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
-import twitter4j.GeoLocation;
-import twitter4j.Location;
-import twitter4j.ResponseList;
-import twitter4j.Trends;
-import twitter4j.TwitterException;
+import org.mariotaku.twidere.api.twitter.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.GeoLocation;
+import org.mariotaku.twidere.api.twitter.model.Location;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
+import org.mariotaku.twidere.api.twitter.model.Trends;
/**
* @author Joern Huxhorn - jhuxhorn at googlemail.com
@@ -36,7 +36,7 @@ public interface TrendsResources {
* This method calls http://api.twitter.com/1.1/trends/available.json
*
* @return the locations
- * @throws twitter4j.TwitterException when Twitter service or network is
+ * @throws TwitterException when Twitter service or network is
* unavailable
* @see GET
@@ -58,7 +58,7 @@ public interface TrendsResources {
* to the lat and long passed in. The sort is nearest to
* furthest.
* @return the locations
- * @throws twitter4j.TwitterException when Twitter service or network is
+ * @throws TwitterException when Twitter service or network is
* unavailable
* @see GET
@@ -81,7 +81,7 @@ public interface TrendsResources {
* to the lat and long passed in. The sort is nearest to
* furthest.
* @return the locations
- * @throws twitter4j.TwitterException when Twitter service or network is
+ * @throws TwitterException when Twitter service or network is
* unavailable
* @see GET
@@ -103,7 +103,7 @@ public interface TrendsResources {
*
* @param woeid The WOEID of the location to be querying for
* @return trends
- * @throws twitter4j.TwitterException when Twitter service or network is
+ * @throws TwitterException when Twitter service or network is
* unavailable
* @see GET
* trends/:woeid | Twitter Developers
@@ -129,7 +129,7 @@ public interface TrendsResources {
* trending information for. Global information is available by
* using 1 as the WOEID.
* @return trends
- * @throws twitter4j.TwitterException when Twitter service or network is
+ * @throws TwitterException when Twitter service or network is
* unavailable
* @see GET
* trends/place | Twitter Developers
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/TweetResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/TweetResources.java
similarity index 83%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/TweetResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/TweetResources.java
index a3e34f15a..a767666a2 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/TweetResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/TweetResources.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
import org.mariotaku.simplerestapi.http.BodyType;
import org.mariotaku.simplerestapi.method.GET;
@@ -27,12 +27,12 @@ import org.mariotaku.simplerestapi.param.Form;
import org.mariotaku.simplerestapi.param.Path;
import org.mariotaku.simplerestapi.param.Query;
-import twitter4j.IDs;
-import twitter4j.Paging;
-import twitter4j.ResponseList;
-import twitter4j.Status;
-import twitter4j.StatusUpdate;
-import twitter4j.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.IDs;
+import org.mariotaku.twidere.api.twitter.model.Paging;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.model.StatusUpdate;
+import org.mariotaku.twidere.api.twitter.TwitterException;
/**
* @author Joern Huxhorn - jhuxhorn at googlemail.com
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/TwitterUpload.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/TwitterUpload.java
similarity index 88%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/TwitterUpload.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/TwitterUpload.java
index d1205054f..66ad9e138 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/TwitterUpload.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/TwitterUpload.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
import org.mariotaku.simplerestapi.http.BodyType;
import org.mariotaku.simplerestapi.http.mime.FileTypedData;
@@ -27,8 +27,8 @@ import org.mariotaku.simplerestapi.param.Part;
import java.io.File;
-import twitter4j.MediaUploadResponse;
-import twitter4j.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.MediaUploadResponse;
+import org.mariotaku.twidere.api.twitter.TwitterException;
public interface TwitterUpload {
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/api/UsersResources.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/UsersResources.java
similarity index 88%
rename from twidere.component.twitter4j/src/main/java/twitter4j/api/UsersResources.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/UsersResources.java
index da1e8c886..a3d628563 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/api/UsersResources.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/api/UsersResources.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package twitter4j.api;
+package org.mariotaku.twidere.api.twitter.api;
import org.mariotaku.simplerestapi.http.BodyType;
import org.mariotaku.simplerestapi.method.GET;
@@ -29,16 +29,16 @@ import org.mariotaku.simplerestapi.param.Query;
import java.io.File;
import java.io.InputStream;
-import twitter4j.AccountSettings;
-import twitter4j.Category;
-import twitter4j.IDs;
-import twitter4j.PageableResponseList;
-import twitter4j.Paging;
-import twitter4j.ProfileUpdate;
-import twitter4j.ResponseList;
-import twitter4j.SettingsUpdate;
-import twitter4j.TwitterException;
-import twitter4j.User;
+import org.mariotaku.twidere.api.twitter.model.AccountSettings;
+import org.mariotaku.twidere.api.twitter.model.Category;
+import org.mariotaku.twidere.api.twitter.model.IDs;
+import org.mariotaku.twidere.api.twitter.model.PageableResponseList;
+import org.mariotaku.twidere.api.twitter.model.Paging;
+import org.mariotaku.twidere.api.twitter.model.ProfileUpdate;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
+import org.mariotaku.twidere.api.twitter.model.SettingsUpdate;
+import org.mariotaku.twidere.api.twitter.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.User;
public interface UsersResources {
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/auth/AuthorizationConfiguration.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/AuthorizationConfiguration.java
similarity index 95%
rename from twidere.component.twitter4j/src/main/java/twitter4j/auth/AuthorizationConfiguration.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/AuthorizationConfiguration.java
index 9aefa66d3..bc9295396 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/auth/AuthorizationConfiguration.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/AuthorizationConfiguration.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j.auth;
+package org.mariotaku.twidere.api.twitter.auth;
/**
* A static factory class for Authorization.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/auth/BasicAuthorization.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/BasicAuthorization.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/auth/BasicAuthorization.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/BasicAuthorization.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/auth/EmptyAuthorization.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/EmptyAuthorization.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/auth/EmptyAuthorization.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/EmptyAuthorization.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/auth/OAuthAuthorization.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/OAuthAuthorization.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/auth/OAuthAuthorization.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/OAuthAuthorization.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/auth/OAuthEndpoint.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/OAuthEndpoint.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/auth/OAuthEndpoint.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/OAuthEndpoint.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/auth/OAuthSupport.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/OAuthSupport.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/auth/OAuthSupport.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/OAuthSupport.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/auth/OAuthToken.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/OAuthToken.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/auth/OAuthToken.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/OAuthToken.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/auth/XAuthAuthorization.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/XAuthAuthorization.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/auth/XAuthAuthorization.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/auth/XAuthAuthorization.java
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/http/HttpResponseCode.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/http/HttpResponseCode.java
similarity index 98%
rename from twidere.component.twitter4j/src/main/java/twitter4j/http/HttpResponseCode.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/http/HttpResponseCode.java
index 4ad9dc3c9..c6221d6d7 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/http/HttpResponseCode.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/http/HttpResponseCode.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j.http;
+package org.mariotaku.twidere.api.twitter.http;
/**
* @author Yusuke Yamamoto - yusuke at mac.com
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/AccountSettings.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/AccountSettings.java
similarity index 97%
rename from twidere.component.twitter4j/src/main/java/twitter4j/AccountSettings.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/AccountSettings.java
index a2499bcf6..567fef885 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/AccountSettings.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/AccountSettings.java
@@ -14,9 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
-
-import java.io.Serializable;
+package org.mariotaku.twidere.api.twitter.model;
/**
* @author Yusuke Yamamoto - yusuke at mac.com
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/AccountTotals.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/AccountTotals.java
similarity index 96%
rename from twidere.component.twitter4j/src/main/java/twitter4j/AccountTotals.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/AccountTotals.java
index d190dd79d..e7390feb4 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/AccountTotals.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/AccountTotals.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import java.io.Serializable;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/Activity.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Activity.java
similarity index 97%
rename from twidere.component.twitter4j/src/main/java/twitter4j/Activity.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Activity.java
index f2ad7d909..6dc5adef0 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/Activity.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Activity.java
@@ -1,4 +1,4 @@
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import java.util.Date;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/CardEntity.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/CardEntity.java
similarity index 97%
rename from twidere.component.twitter4j/src/main/java/twitter4j/CardEntity.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/CardEntity.java
index 958df0f5f..dacef9db5 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/CardEntity.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/CardEntity.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import java.util.Map;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/Category.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Category.java
similarity index 94%
rename from twidere.component.twitter4j/src/main/java/twitter4j/Category.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Category.java
index 304839d71..89c0dd89e 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/Category.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Category.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import java.io.Serializable;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/CursorSupport.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/CursorSupport.java
similarity index 95%
rename from twidere.component.twitter4j/src/main/java/twitter4j/CursorSupport.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/CursorSupport.java
index e30947104..7a43399f5 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/CursorSupport.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/CursorSupport.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
/**
* @author Yusuke Yamamoto - yusuke at mac.com
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/DirectMessage.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/DirectMessage.java
similarity index 95%
rename from twidere.component.twitter4j/src/main/java/twitter4j/DirectMessage.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/DirectMessage.java
index ecba85b66..05bbd1ea1 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/DirectMessage.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/DirectMessage.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import java.util.Date;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/EntitySupport.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/EntitySupport.java
similarity index 97%
rename from twidere.component.twitter4j/src/main/java/twitter4j/EntitySupport.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/EntitySupport.java
index 1792c0f55..c09723490 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/EntitySupport.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/EntitySupport.java
@@ -14,9 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
-
-import java.io.Serializable;
+package org.mariotaku.twidere.api.twitter.model;
/**
* @author Yusuke Yamamoto - yusuke at mac.com
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/ErrorInfo.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/ErrorInfo.java
similarity index 95%
rename from twidere.component.twitter4j/src/main/java/twitter4j/ErrorInfo.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/ErrorInfo.java
index 5258928d3..a999f808f 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/ErrorInfo.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/ErrorInfo.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/lib/MyClass.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/ExtendedEntitySupport.java
similarity index 82%
rename from twidere.component.twitter4j/src/main/java/twitter4j/lib/MyClass.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/ExtendedEntitySupport.java
index 1d2f03a8b..af8cda4cb 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/lib/MyClass.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/ExtendedEntitySupport.java
@@ -17,7 +17,10 @@
* along with this program. If not, see .
*/
-package twitter4j.lib;
+package org.mariotaku.twidere.api.twitter.model;
+
+public interface ExtendedEntitySupport extends EntitySupport {
+
+ MediaEntity[] getExtendedMediaEntities();
-public class MyClass {
}
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/Friendship.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Friendship.java
similarity index 94%
rename from twidere.component.twitter4j/src/main/java/twitter4j/Friendship.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Friendship.java
index 2eca37153..c9a873b45 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/Friendship.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Friendship.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
/**
* @author Yusuke Yamamoto - yusuke at mac.com
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/GeoLocation.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/GeoLocation.java
similarity index 98%
rename from twidere.component.twitter4j/src/main/java/twitter4j/GeoLocation.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/GeoLocation.java
index 0cd54f575..ccdf336bd 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/GeoLocation.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/GeoLocation.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import com.bluelinelabs.logansquare.LoganSquare;
import com.bluelinelabs.logansquare.typeconverters.TypeConverter;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/GeoQuery.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/GeoQuery.java
similarity index 99%
rename from twidere.component.twitter4j/src/main/java/twitter4j/GeoQuery.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/GeoQuery.java
index 48bb17f60..12a807e83 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/GeoQuery.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/GeoQuery.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import org.mariotaku.simplerestapi.http.ValueMap;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/HashtagEntity.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/HashtagEntity.java
similarity index 96%
rename from twidere.component.twitter4j/src/main/java/twitter4j/HashtagEntity.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/HashtagEntity.java
index 86a8a41b1..797ac0d3e 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/HashtagEntity.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/HashtagEntity.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import java.io.Serializable;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/IDs.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/IDs.java
similarity index 94%
rename from twidere.component.twitter4j/src/main/java/twitter4j/IDs.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/IDs.java
index 304ef70eb..611861f21 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/IDs.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/IDs.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
/**
* A data interface representing array of numeric IDs.
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/Location.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Location.java
similarity index 94%
rename from twidere.component.twitter4j/src/main/java/twitter4j/Location.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Location.java
index 27a913c18..7bc9a5bdf 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/Location.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Location.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
/**
* @author Yusuke Yamamoto - yusuke at mac.com
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/MediaEntity.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/MediaEntity.java
similarity index 96%
rename from twidere.component.twitter4j/src/main/java/twitter4j/MediaEntity.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/MediaEntity.java
index 7326d2982..656d76b21 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/MediaEntity.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/MediaEntity.java
@@ -1,8 +1,7 @@
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
-import java.io.Serializable;
import java.util.Map;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/MediaUploadResponse.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/MediaUploadResponse.java
similarity index 83%
rename from twidere.component.twitter4j/src/main/java/twitter4j/MediaUploadResponse.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/MediaUploadResponse.java
index fa0959e26..807db93d7 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/MediaUploadResponse.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/MediaUploadResponse.java
@@ -1,4 +1,4 @@
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
public interface MediaUploadResponse extends TwitterResponse {
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/PageableResponseList.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/PageableResponseList.java
similarity index 95%
rename from twidere.component.twitter4j/src/main/java/twitter4j/PageableResponseList.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/PageableResponseList.java
index 5f935f468..260123317 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/PageableResponseList.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/PageableResponseList.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
/**
* ResponseList with cursor support.
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/Paging.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Paging.java
similarity index 98%
rename from twidere.component.twitter4j/src/main/java/twitter4j/Paging.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Paging.java
index be4dc3c09..8019cf38d 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/Paging.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Paging.java
@@ -1,4 +1,4 @@
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import org.mariotaku.simplerestapi.http.ValueMap;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/Place.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Place.java
similarity index 91%
rename from twidere.component.twitter4j/src/main/java/twitter4j/Place.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Place.java
index 978e44ab4..8cfdacec6 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/Place.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Place.java
@@ -1,4 +1,4 @@
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
/**
* @author Yusuke Yamamoto - yusuke at mac.com
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/ProfileUpdate.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/ProfileUpdate.java
similarity index 97%
rename from twidere.component.twitter4j/src/main/java/twitter4j/ProfileUpdate.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/ProfileUpdate.java
index 4e51b1907..9d53cb6e7 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/ProfileUpdate.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/ProfileUpdate.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import org.mariotaku.simplerestapi.http.SimpleValueMap;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/QueryResult.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/QueryResult.java
similarity index 94%
rename from twidere.component.twitter4j/src/main/java/twitter4j/QueryResult.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/QueryResult.java
index 9906385ff..5eb55d0be 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/QueryResult.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/QueryResult.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
/**
* A data interface representing search API response
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/RateLimitStatus.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/RateLimitStatus.java
similarity index 97%
rename from twidere.component.twitter4j/src/main/java/twitter4j/RateLimitStatus.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/RateLimitStatus.java
index 2d84c55bd..dd9c895ef 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/RateLimitStatus.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/RateLimitStatus.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
/**
* A data interface representing Twitter REST API's rate limit status
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/Relationship.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Relationship.java
similarity index 98%
rename from twidere.component.twitter4j/src/main/java/twitter4j/Relationship.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Relationship.java
index dabd34a20..7fb7119dc 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/Relationship.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Relationship.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
public interface Relationship extends TwitterResponse {
boolean canSourceDMTarget();
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/ReportAs.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/ReportAs.java
similarity index 88%
rename from twidere.component.twitter4j/src/main/java/twitter4j/ReportAs.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/ReportAs.java
index 43ddce5ae..a892d2b87 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/ReportAs.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/ReportAs.java
@@ -1,4 +1,4 @@
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
public enum ReportAs {
ABUSE("abuse"), COMPROMISED("compromised"), SPAM("spam");
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/ResponseList.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/ResponseList.java
similarity index 94%
rename from twidere.component.twitter4j/src/main/java/twitter4j/ResponseList.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/ResponseList.java
index b32ed8ea1..cff43234d 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/ResponseList.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/ResponseList.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import java.util.List;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/SavedSearch.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/SavedSearch.java
similarity index 89%
rename from twidere.component.twitter4j/src/main/java/twitter4j/SavedSearch.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/SavedSearch.java
index b85d6f816..d88defc5a 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/SavedSearch.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/SavedSearch.java
@@ -14,11 +14,8 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-import java.io.Serializable;
import java.util.Date;
/**
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/SearchQuery.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/SearchQuery.java
similarity index 99%
rename from twidere.component.twitter4j/src/main/java/twitter4j/SearchQuery.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/SearchQuery.java
index 58fc21806..e2d141758 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/SearchQuery.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/SearchQuery.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import org.mariotaku.simplerestapi.http.ValueMap;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/SettingsUpdate.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/SettingsUpdate.java
similarity index 97%
rename from twidere.component.twitter4j/src/main/java/twitter4j/SettingsUpdate.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/SettingsUpdate.java
index 38b8192fb..096712fcf 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/SettingsUpdate.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/SettingsUpdate.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import org.mariotaku.simplerestapi.http.SimpleValueMap;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/SimilarPlaces.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/SimilarPlaces.java
similarity index 53%
rename from twidere.component.twitter4j/src/main/java/twitter4j/SimilarPlaces.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/SimilarPlaces.java
index 2557cc9ec..f0109876b 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/SimilarPlaces.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/SimilarPlaces.java
@@ -14,7 +14,11 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
+
+import org.mariotaku.twidere.api.twitter.model.GeoLocation;
+import org.mariotaku.twidere.api.twitter.model.Place;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
import java.io.Serializable;
@@ -23,13 +27,13 @@ import java.io.Serializable;
* @since Twitter4J 2.1.7
*/
public interface SimilarPlaces extends ResponseList, Serializable {
- /**
- * Returns the token needed to be able to create a new place with
- * {@link twitter4j.api.PlacesGeoResources#createPlace(String, String, String, GeoLocation, String)}
- * .
- *
- * @return token the token needed to be able to create a new place with
- * {@link twitter4j.api.PlacesGeoResources#createPlace(String, String, String, GeoLocation, String)}
- */
- String getToken();
+ /**
+ * Returns the token needed to be able to create a new place with
+ * {@link org.mariotaku.twidere.api.twitter.api.PlacesGeoResources#createPlace(String, String, String, GeoLocation, String)}
+ * .
+ *
+ * @return token the token needed to be able to create a new place with
+ * {@link org.mariotaku.twidere.api.twitter.api.PlacesGeoResources#createPlace(String, String, String, GeoLocation, String)}
+ */
+ String getToken();
}
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/Status.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Status.java
similarity index 98%
rename from twidere.component.twitter4j/src/main/java/twitter4j/Status.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Status.java
index 7459a55f8..0bb69fcc1 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/Status.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Status.java
@@ -14,9 +14,8 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
-import java.io.Serializable;
import java.util.Date;
/**
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/StatusActivitySummary.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/StatusActivitySummary.java
similarity index 86%
rename from twidere.component.twitter4j/src/main/java/twitter4j/StatusActivitySummary.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/StatusActivitySummary.java
index 41a4510f8..ee24c326d 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/StatusActivitySummary.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/StatusActivitySummary.java
@@ -1,4 +1,4 @@
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
public interface StatusActivitySummary extends TwitterResponse {
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/StatusUpdate.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/StatusUpdate.java
similarity index 98%
rename from twidere.component.twitter4j/src/main/java/twitter4j/StatusUpdate.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/StatusUpdate.java
index 935265b16..a23dea8a6 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/StatusUpdate.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/StatusUpdate.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import org.mariotaku.simplerestapi.Utils;
import org.mariotaku.simplerestapi.http.SimpleValueMap;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/TimeZone.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/TimeZone.java
similarity index 94%
rename from twidere.component.twitter4j/src/main/java/twitter4j/TimeZone.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/TimeZone.java
index 763c16789..62d367c38 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/TimeZone.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/TimeZone.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import java.io.Serializable;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/TranslationResult.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/TranslationResult.java
similarity index 65%
rename from twidere.component.twitter4j/src/main/java/twitter4j/TranslationResult.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/TranslationResult.java
index 1a858acdd..a19a0fac1 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/TranslationResult.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/TranslationResult.java
@@ -1,4 +1,6 @@
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
+
+import org.mariotaku.twidere.api.twitter.model.TwitterResponse;
public interface TranslationResult extends TwitterResponse {
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/Trend.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Trend.java
similarity index 94%
rename from twidere.component.twitter4j/src/main/java/twitter4j/Trend.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Trend.java
index 1cf2f5d8b..f0a6e8b0a 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/Trend.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Trend.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import java.io.Serializable;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/Trends.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Trends.java
similarity index 96%
rename from twidere.component.twitter4j/src/main/java/twitter4j/Trends.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Trends.java
index 2f8e3e19f..e92f9cb35 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/Trends.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/Trends.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import java.io.Serializable;
import java.util.Date;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/TwitterAPIConfiguration.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/TwitterAPIConfiguration.java
similarity index 85%
rename from twidere.component.twitter4j/src/main/java/twitter4j/TwitterAPIConfiguration.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/TwitterAPIConfiguration.java
index 2d5649bed..2f6afab5e 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/TwitterAPIConfiguration.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/TwitterAPIConfiguration.java
@@ -14,9 +14,11 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
+
+import org.mariotaku.twidere.api.twitter.model.MediaEntity;
+import org.mariotaku.twidere.api.twitter.model.TwitterResponse;
-import java.io.Serializable;
import java.util.Map;
/**
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/TwitterResponse.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/TwitterResponse.java
similarity index 94%
rename from twidere.component.twitter4j/src/main/java/twitter4j/TwitterResponse.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/TwitterResponse.java
index b44cf884b..a8b3350d7 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/TwitterResponse.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/TwitterResponse.java
@@ -17,19 +17,17 @@
* along with this program. If not, see .
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import org.mariotaku.simplerestapi.http.RestResponse;
-import java.io.Serializable;
-
/**
* Super interface of Twitter Response data interfaces which indicates that rate
* limit status is avaialble.
*
* @author Yusuke Yamamoto - yusuke at mac.com
* @see DirectMessage
- * @see twitter4j.Status
+ * @see Status
* @see User
*/
public interface TwitterResponse {
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/UrlEntity.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/UrlEntity.java
similarity index 97%
rename from twidere.component.twitter4j/src/main/java/twitter4j/UrlEntity.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/UrlEntity.java
index ce8f929c1..bdbd1efa9 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/UrlEntity.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/UrlEntity.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import java.io.Serializable;
import java.net.URL;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/User.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/User.java
similarity index 98%
rename from twidere.component.twitter4j/src/main/java/twitter4j/User.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/User.java
index 079c1c1f0..653cae97b 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/User.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/User.java
@@ -14,9 +14,8 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
-import java.io.Serializable;
import java.util.Date;
/**
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/UserList.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/UserList.java
similarity index 96%
rename from twidere.component.twitter4j/src/main/java/twitter4j/UserList.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/UserList.java
index 47023a1c8..45b190687 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/UserList.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/UserList.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import java.util.Date;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/UserListUpdate.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/UserListUpdate.java
similarity index 96%
rename from twidere.component.twitter4j/src/main/java/twitter4j/UserListUpdate.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/UserListUpdate.java
index 359d5f9e7..25d9e477a 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/UserListUpdate.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/UserListUpdate.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
import org.mariotaku.simplerestapi.http.SimpleValueMap;
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/UserMentionEntity.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/UserMentionEntity.java
similarity index 97%
rename from twidere.component.twitter4j/src/main/java/twitter4j/UserMentionEntity.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/UserMentionEntity.java
index eceeeff43..2873add57 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/UserMentionEntity.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/UserMentionEntity.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j;
+package org.mariotaku.twidere.api.twitter.model;
/**
* A data interface representing one single user mention entity.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/CardEntityImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/CardEntityImpl.java
similarity index 96%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/CardEntityImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/CardEntityImpl.java
index 70a98341c..71d7ddcf2 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/CardEntityImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/CardEntityImpl.java
@@ -26,9 +26,9 @@ import org.mariotaku.simplerestapi.http.RestResponse;
import java.util.Map;
-import twitter4j.CardEntity;
-import twitter4j.RateLimitStatus;
-import twitter4j.User;
+import org.mariotaku.twidere.api.twitter.model.CardEntity;
+import org.mariotaku.twidere.api.twitter.model.RateLimitStatus;
+import org.mariotaku.twidere.api.twitter.model.User;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/DirectMessageImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/DirectMessageImpl.java
similarity index 88%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/DirectMessageImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/DirectMessageImpl.java
index e4e079f00..29c8c0c60 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/DirectMessageImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/DirectMessageImpl.java
@@ -22,15 +22,15 @@ package org.mariotaku.twidere.api.twitter.model.impl;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import org.mariotaku.twidere.api.twitter.TwitterDateConverter;
+import org.mariotaku.twidere.api.twitter.util.TwitterDateConverter;
import java.util.Date;
-import twitter4j.DirectMessage;
-import twitter4j.HashtagEntity;
-import twitter4j.MediaEntity;
-import twitter4j.UrlEntity;
-import twitter4j.UserMentionEntity;
+import org.mariotaku.twidere.api.twitter.model.DirectMessage;
+import org.mariotaku.twidere.api.twitter.model.HashtagEntity;
+import org.mariotaku.twidere.api.twitter.model.MediaEntity;
+import org.mariotaku.twidere.api.twitter.model.UrlEntity;
+import org.mariotaku.twidere.api.twitter.model.UserMentionEntity;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/EntitiesImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/EntitiesImpl.java
similarity index 88%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/EntitiesImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/EntitiesImpl.java
index 100ae4afe..c0a64498a 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/EntitiesImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/EntitiesImpl.java
@@ -24,10 +24,10 @@ import com.bluelinelabs.logansquare.annotation.JsonObject;
import java.util.Arrays;
-import twitter4j.HashtagEntity;
-import twitter4j.MediaEntity;
-import twitter4j.UrlEntity;
-import twitter4j.UserMentionEntity;
+import org.mariotaku.twidere.api.twitter.model.HashtagEntity;
+import org.mariotaku.twidere.api.twitter.model.MediaEntity;
+import org.mariotaku.twidere.api.twitter.model.UrlEntity;
+import org.mariotaku.twidere.api.twitter.model.UserMentionEntity;
/**
* Created by mariotaku on 15/3/31.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/ErrorInfoImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/ErrorInfoImpl.java
similarity index 95%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/ErrorInfoImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/ErrorInfoImpl.java
index a50031173..d13184320 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/ErrorInfoImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/ErrorInfoImpl.java
@@ -22,7 +22,7 @@ package org.mariotaku.twidere.api.twitter.model.impl;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import twitter4j.*;
+import org.mariotaku.twidere.api.twitter.model.ErrorInfo;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/GeoPoint.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/GeoPoint.java
similarity index 95%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/GeoPoint.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/GeoPoint.java
index b910ccdfa..b536369cd 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/GeoPoint.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/GeoPoint.java
@@ -22,7 +22,7 @@ package org.mariotaku.twidere.api.twitter.model.impl;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import twitter4j.GeoLocation;
+import org.mariotaku.twidere.api.twitter.model.GeoLocation;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/HashtagEntityImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/HashtagEntityImpl.java
similarity index 95%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/HashtagEntityImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/HashtagEntityImpl.java
index 89513efaa..b1682f6e6 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/HashtagEntityImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/HashtagEntityImpl.java
@@ -22,7 +22,7 @@ package org.mariotaku.twidere.api.twitter.model.impl;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import twitter4j.HashtagEntity;
+import org.mariotaku.twidere.api.twitter.model.HashtagEntity;
/**
* Created by mariotaku on 15/3/31.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/Indices.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/Indices.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/Indices.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/Indices.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/MediaEntityImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/MediaEntityImpl.java
similarity index 99%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/MediaEntityImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/MediaEntityImpl.java
index 5b3db6852..e2229f331 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/MediaEntityImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/MediaEntityImpl.java
@@ -26,7 +26,7 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
-import twitter4j.MediaEntity;
+import org.mariotaku.twidere.api.twitter.model.MediaEntity;
/**
* Created by mariotaku on 15/3/31.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/MediaUploadResponseImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/MediaUploadResponseImpl.java
similarity index 96%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/MediaUploadResponseImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/MediaUploadResponseImpl.java
index f83faff32..d0928c911 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/MediaUploadResponseImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/MediaUploadResponseImpl.java
@@ -22,7 +22,7 @@ package org.mariotaku.twidere.api.twitter.model.impl;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import twitter4j.MediaUploadResponse;
+import org.mariotaku.twidere.api.twitter.model.MediaUploadResponse;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListImpl.java
similarity index 91%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListImpl.java
index ea1af5cdf..114ea8d9f 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListImpl.java
@@ -19,12 +19,9 @@
package org.mariotaku.twidere.api.twitter.model.impl;
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
import java.util.Collection;
-import twitter4j.PageableResponseList;
+import org.mariotaku.twidere.api.twitter.model.PageableResponseList;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListMapper.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListMapper.java
similarity index 95%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListMapper.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListMapper.java
index f1f72142a..a1a4ec119 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListMapper.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListMapper.java
@@ -25,14 +25,14 @@ import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
-import org.mariotaku.twidere.api.twitter.TwitterConverter;
+import org.mariotaku.twidere.api.twitter.util.TwitterConverter;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
-import twitter4j.Status;
-import twitter4j.User;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.model.User;
public final class PageableResponseListMapper extends JsonMapper> {
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListWrapper.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListWrapper.java
similarity index 87%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListWrapper.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListWrapper.java
index 3471c9ee5..aed3762a1 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListWrapper.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PageableResponseListWrapper.java
@@ -22,15 +22,15 @@ package org.mariotaku.twidere.api.twitter.model.impl;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import org.mariotaku.twidere.api.twitter.TwitterConverter;
+import org.mariotaku.twidere.api.twitter.util.TwitterConverter;
import java.lang.reflect.Type;
import java.util.ArrayList;
-import twitter4j.PageableResponseList;
-import twitter4j.Status;
-import twitter4j.User;
-import twitter4j.UserList;
+import org.mariotaku.twidere.api.twitter.model.PageableResponseList;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.model.User;
+import org.mariotaku.twidere.api.twitter.model.UserList;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PlaceImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PlaceImpl.java
similarity index 95%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PlaceImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PlaceImpl.java
index 04afe62ea..828c3c3e1 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PlaceImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/PlaceImpl.java
@@ -22,9 +22,8 @@ package org.mariotaku.twidere.api.twitter.model.impl;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import twitter4j.GeoLocation;
-import twitter4j.Place;
-import twitter4j.RateLimitStatus;
+import org.mariotaku.twidere.api.twitter.model.GeoLocation;
+import org.mariotaku.twidere.api.twitter.model.Place;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/QueryResultImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/QueryResultImpl.java
similarity index 93%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/QueryResultImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/QueryResultImpl.java
index 05cd39a01..c0d24ba9a 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/QueryResultImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/QueryResultImpl.java
@@ -21,8 +21,8 @@ package org.mariotaku.twidere.api.twitter.model.impl;
import java.util.ArrayList;
-import twitter4j.QueryResult;
-import twitter4j.Status;
+import org.mariotaku.twidere.api.twitter.model.QueryResult;
+import org.mariotaku.twidere.api.twitter.model.Status;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/QueryResultWrapper.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/QueryResultWrapper.java
similarity index 94%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/QueryResultWrapper.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/QueryResultWrapper.java
index 3f29657df..6f25b1bf1 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/QueryResultWrapper.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/QueryResultWrapper.java
@@ -24,8 +24,8 @@ import com.bluelinelabs.logansquare.annotation.JsonObject;
import java.util.ArrayList;
-import twitter4j.QueryResult;
-import twitter4j.Status;
+import org.mariotaku.twidere.api.twitter.model.QueryResult;
+import org.mariotaku.twidere.api.twitter.model.Status;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RateLimitStatusJSONImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RateLimitStatusJSONImpl.java
similarity index 98%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RateLimitStatusJSONImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RateLimitStatusJSONImpl.java
index 490a6723a..0d2087c7d 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RateLimitStatusJSONImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RateLimitStatusJSONImpl.java
@@ -24,7 +24,7 @@ import com.bluelinelabs.logansquare.annotation.JsonObject;
import org.mariotaku.simplerestapi.http.RestResponse;
-import twitter4j.RateLimitStatus;
+import org.mariotaku.twidere.api.twitter.model.RateLimitStatus;
/**
* A data class representing Twitter REST API's rate limit status
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RelationshipImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RelationshipImpl.java
similarity index 98%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RelationshipImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RelationshipImpl.java
index 88aaee072..3df0e2e1d 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RelationshipImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RelationshipImpl.java
@@ -22,7 +22,7 @@ package org.mariotaku.twidere.api.twitter.model.impl;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import twitter4j.Relationship;
+import org.mariotaku.twidere.api.twitter.model.Relationship;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RelationshipWrapper.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RelationshipWrapper.java
similarity index 95%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RelationshipWrapper.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RelationshipWrapper.java
index 5525ed691..47dd4d46f 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RelationshipWrapper.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/RelationshipWrapper.java
@@ -22,7 +22,7 @@ package org.mariotaku.twidere.api.twitter.model.impl;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import twitter4j.Relationship;
+import org.mariotaku.twidere.api.twitter.model.Relationship;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/ResponseListImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/ResponseListImpl.java
similarity index 90%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/ResponseListImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/ResponseListImpl.java
index 854213cb5..080376638 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/ResponseListImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/ResponseListImpl.java
@@ -24,9 +24,9 @@ import org.mariotaku.simplerestapi.http.RestResponse;
import java.util.ArrayList;
import java.util.Collection;
-import twitter4j.RateLimitStatus;
-import twitter4j.ResponseList;
-import twitter4j.internal.util.InternalParseUtil;
+import org.mariotaku.twidere.api.twitter.model.RateLimitStatus;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
+import org.mariotaku.twidere.api.twitter.util.InternalParseUtil;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/SavedSearchImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/SavedSearchImpl.java
similarity index 93%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/SavedSearchImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/SavedSearchImpl.java
index 60b6ad3f7..1219b8e19 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/SavedSearchImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/SavedSearchImpl.java
@@ -24,12 +24,11 @@ import android.support.annotation.NonNull;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import org.mariotaku.twidere.api.twitter.TwitterDateConverter;
+import org.mariotaku.twidere.api.twitter.util.TwitterDateConverter;
import java.util.Date;
-import twitter4j.RateLimitStatus;
-import twitter4j.SavedSearch;
+import org.mariotaku.twidere.api.twitter.model.SavedSearch;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/StatusImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/StatusImpl.java
similarity index 92%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/StatusImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/StatusImpl.java
index a9b110e7b..5c91aed48 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/StatusImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/StatusImpl.java
@@ -24,21 +24,20 @@ import android.support.annotation.NonNull;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import org.mariotaku.twidere.api.twitter.TwitterDateConverter;
+import org.mariotaku.twidere.api.twitter.util.TwitterDateConverter;
import java.util.Arrays;
import java.util.Date;
-import twitter4j.CardEntity;
-import twitter4j.GeoLocation;
-import twitter4j.HashtagEntity;
-import twitter4j.MediaEntity;
-import twitter4j.Place;
-import twitter4j.RateLimitStatus;
-import twitter4j.Status;
-import twitter4j.UrlEntity;
-import twitter4j.User;
-import twitter4j.UserMentionEntity;
+import org.mariotaku.twidere.api.twitter.model.CardEntity;
+import org.mariotaku.twidere.api.twitter.model.GeoLocation;
+import org.mariotaku.twidere.api.twitter.model.HashtagEntity;
+import org.mariotaku.twidere.api.twitter.model.MediaEntity;
+import org.mariotaku.twidere.api.twitter.model.Place;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.model.UrlEntity;
+import org.mariotaku.twidere.api.twitter.model.User;
+import org.mariotaku.twidere.api.twitter.model.UserMentionEntity;
/**
* Created by mariotaku on 15/5/5.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/TranslationResultImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/TranslationResultImpl.java
similarity index 96%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/TranslationResultImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/TranslationResultImpl.java
index e531f1d15..7c85f4876 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/TranslationResultImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/TranslationResultImpl.java
@@ -22,7 +22,7 @@ package org.mariotaku.twidere.api.twitter.model.impl;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import twitter4j.TranslationResult;
+import org.mariotaku.twidere.api.twitter.model.TranslationResult;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/TwitterResponseImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/TwitterResponseImpl.java
similarity index 88%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/TwitterResponseImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/TwitterResponseImpl.java
index 3331c21ed..019dce813 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/TwitterResponseImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/TwitterResponseImpl.java
@@ -21,9 +21,9 @@ package org.mariotaku.twidere.api.twitter.model.impl;
import org.mariotaku.simplerestapi.http.RestResponse;
-import twitter4j.RateLimitStatus;
-import twitter4j.TwitterResponse;
-import twitter4j.internal.util.InternalParseUtil;
+import org.mariotaku.twidere.api.twitter.model.RateLimitStatus;
+import org.mariotaku.twidere.api.twitter.model.TwitterResponse;
+import org.mariotaku.twidere.api.twitter.util.InternalParseUtil;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/TypeConverterMapper.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/TypeConverterMapper.java
similarity index 100%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/TypeConverterMapper.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/TypeConverterMapper.java
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UrlEntityImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UrlEntityImpl.java
similarity index 97%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UrlEntityImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UrlEntityImpl.java
index 3debfe5b0..cf0c16c89 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UrlEntityImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UrlEntityImpl.java
@@ -22,7 +22,7 @@ package org.mariotaku.twidere.api.twitter.model.impl;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import twitter4j.UrlEntity;
+import org.mariotaku.twidere.api.twitter.model.UrlEntity;
/**
* Created by mariotaku on 15/3/31.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserEntitiesImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserEntitiesImpl.java
similarity index 96%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserEntitiesImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserEntitiesImpl.java
index a1e7ee323..730c99a0d 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserEntitiesImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserEntitiesImpl.java
@@ -22,7 +22,7 @@ package org.mariotaku.twidere.api.twitter.model.impl;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import twitter4j.UrlEntity;
+import org.mariotaku.twidere.api.twitter.model.UrlEntity;
/**
* Created by mariotaku on 15/3/31.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserImpl.java
similarity index 98%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserImpl.java
index 09ea8b693..a27d934aa 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserImpl.java
@@ -25,13 +25,13 @@ import android.support.annotation.NonNull;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import org.mariotaku.twidere.api.twitter.TwitterDateConverter;
+import org.mariotaku.twidere.api.twitter.util.TwitterDateConverter;
import java.util.Date;
-import twitter4j.Status;
-import twitter4j.UrlEntity;
-import twitter4j.User;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.model.UrlEntity;
+import org.mariotaku.twidere.api.twitter.model.User;
/**
* Created by mariotaku on 15/3/31.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserListImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserListImpl.java
similarity index 95%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserListImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserListImpl.java
index 280c92dd3..77cd9066f 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserListImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserListImpl.java
@@ -24,12 +24,12 @@ import android.support.annotation.NonNull;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import org.mariotaku.twidere.api.twitter.TwitterDateConverter;
+import org.mariotaku.twidere.api.twitter.util.TwitterDateConverter;
import java.util.Date;
-import twitter4j.User;
-import twitter4j.UserList;
+import org.mariotaku.twidere.api.twitter.model.User;
+import org.mariotaku.twidere.api.twitter.model.UserList;
/**
* Created by mariotaku on 15/4/7.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserMentionEntityImpl.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserMentionEntityImpl.java
similarity index 96%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserMentionEntityImpl.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserMentionEntityImpl.java
index 9ce060ea7..4e5bfcd56 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserMentionEntityImpl.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/UserMentionEntityImpl.java
@@ -22,7 +22,7 @@ package org.mariotaku.twidere.api.twitter.model.impl;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import twitter4j.UserMentionEntity;
+import org.mariotaku.twidere.api.twitter.model.UserMentionEntity;
/**
* Created by mariotaku on 15/3/31.
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/Wrapper.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/Wrapper.java
similarity index 93%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/Wrapper.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/Wrapper.java
index 2cbb56e20..b6634be5f 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/Wrapper.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/model/impl/Wrapper.java
@@ -19,7 +19,7 @@
package org.mariotaku.twidere.api.twitter.model.impl;
-import twitter4j.TwitterResponse;
+import org.mariotaku.twidere.api.twitter.model.TwitterResponse;
/**
* Created by mariotaku on 15/5/7.
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/util/CharacterUtil.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/util/CharacterUtil.java
similarity index 96%
rename from twidere.component.twitter4j/src/main/java/twitter4j/util/CharacterUtil.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/util/CharacterUtil.java
index b4e6e0e1a..8da16bccb 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/util/CharacterUtil.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/util/CharacterUtil.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j.util;
+package org.mariotaku.twidere.api.twitter.util;
/**
* @author Yusuke Yamamoto - yusuke at mac.com
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/internal/util/InternalParseUtil.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/util/InternalParseUtil.java
similarity index 97%
rename from twidere.component.twitter4j/src/main/java/twitter4j/internal/util/InternalParseUtil.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/util/InternalParseUtil.java
index 9685cd611..957714979 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/internal/util/InternalParseUtil.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/util/InternalParseUtil.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package twitter4j.internal.util;
+package org.mariotaku.twidere.api.twitter.util;
import org.json.JSONException;
import org.json.JSONObject;
@@ -34,8 +34,8 @@ import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
-import twitter4j.TwitterException;
-import twitter4j.TwitterResponse;
+import org.mariotaku.twidere.api.twitter.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.TwitterResponse;
/**
* A tiny parse utility class.
diff --git a/twidere.component.twitter4j/src/main/java/twitter4j/util/TimeSpanConverter.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/util/TimeSpanConverter.java
similarity index 99%
rename from twidere.component.twitter4j/src/main/java/twitter4j/util/TimeSpanConverter.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/util/TimeSpanConverter.java
index 3b91aec1c..991ae77a5 100644
--- a/twidere.component.twitter4j/src/main/java/twitter4j/util/TimeSpanConverter.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/util/TimeSpanConverter.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package twitter4j.util;
+package org.mariotaku.twidere.api.twitter.util;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/TwitterConverter.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/util/TwitterConverter.java
similarity index 90%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/TwitterConverter.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/util/TwitterConverter.java
index dd2c7d83d..fc037f31e 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/TwitterConverter.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/util/TwitterConverter.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package org.mariotaku.twidere.api.twitter;
+package org.mariotaku.twidere.api.twitter.util;
import com.bluelinelabs.logansquare.LoganSquare;
import com.bluelinelabs.logansquare.typeconverters.TypeConverter;
@@ -29,7 +29,27 @@ import org.mariotaku.simplerestapi.Converter;
import org.mariotaku.simplerestapi.http.ContentType;
import org.mariotaku.simplerestapi.http.RestResponse;
import org.mariotaku.simplerestapi.http.mime.TypedData;
+import org.mariotaku.twidere.api.twitter.TwitterException;
+import org.mariotaku.twidere.api.twitter.model.UserMentionEntity;
import org.mariotaku.twidere.api.twitter.auth.OAuthToken;
+import org.mariotaku.twidere.api.twitter.model.CardEntity;
+import org.mariotaku.twidere.api.twitter.model.DirectMessage;
+import org.mariotaku.twidere.api.twitter.model.ErrorInfo;
+import org.mariotaku.twidere.api.twitter.model.GeoLocation;
+import org.mariotaku.twidere.api.twitter.model.HashtagEntity;
+import org.mariotaku.twidere.api.twitter.model.MediaEntity;
+import org.mariotaku.twidere.api.twitter.model.MediaUploadResponse;
+import org.mariotaku.twidere.api.twitter.model.PageableResponseList;
+import org.mariotaku.twidere.api.twitter.model.Place;
+import org.mariotaku.twidere.api.twitter.model.QueryResult;
+import org.mariotaku.twidere.api.twitter.model.Relationship;
+import org.mariotaku.twidere.api.twitter.model.ResponseList;
+import org.mariotaku.twidere.api.twitter.model.SavedSearch;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.model.TranslationResult;
+import org.mariotaku.twidere.api.twitter.model.UrlEntity;
+import org.mariotaku.twidere.api.twitter.model.User;
+import org.mariotaku.twidere.api.twitter.model.UserList;
import org.mariotaku.twidere.api.twitter.model.impl.CardEntityImpl;
import org.mariotaku.twidere.api.twitter.model.impl.DirectMessageImpl;
import org.mariotaku.twidere.api.twitter.model.impl.ErrorInfoImpl;
@@ -67,27 +87,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import twitter4j.CardEntity;
-import twitter4j.DirectMessage;
-import twitter4j.ErrorInfo;
-import twitter4j.GeoLocation;
-import twitter4j.HashtagEntity;
-import twitter4j.MediaEntity;
-import twitter4j.MediaUploadResponse;
-import twitter4j.PageableResponseList;
-import twitter4j.Place;
-import twitter4j.QueryResult;
-import twitter4j.Relationship;
-import twitter4j.ResponseList;
-import twitter4j.SavedSearch;
-import twitter4j.Status;
-import twitter4j.TranslationResult;
-import twitter4j.TwitterException;
-import twitter4j.UrlEntity;
-import twitter4j.User;
-import twitter4j.UserList;
-import twitter4j.UserMentionEntity;
-
/**
* Created by mariotaku on 15/5/5.
*/
diff --git a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/TwitterDateConverter.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/util/TwitterDateConverter.java
similarity index 96%
rename from twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/TwitterDateConverter.java
rename to twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/util/TwitterDateConverter.java
index 822477833..12dc948cf 100644
--- a/twidere.component.twitter4j/src/main/java/org/mariotaku/twidere/api/twitter/TwitterDateConverter.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/api/twitter/util/TwitterDateConverter.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package org.mariotaku.twidere.api.twitter;
+package org.mariotaku.twidere.api.twitter.util;
import com.bluelinelabs.logansquare.typeconverters.DateTypeConverter;
diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/constant/SharedPreferenceConstants.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/constant/SharedPreferenceConstants.java
index 4b6aef789..546b565e3 100644
--- a/twidere.component.common/src/main/java/org/mariotaku/twidere/constant/SharedPreferenceConstants.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/constant/SharedPreferenceConstants.java
@@ -151,8 +151,6 @@ public interface SharedPreferenceConstants {
String KEY_LEFTSIDE_COMPOSE_BUTTON = "leftside_compose_button";
@Preference(type = BOOLEAN, exportable = false, hasDefault = true, defaultBoolean = false)
String KEY_ATTACH_LOCATION = "attach_location";
- @Preference(type = BOOLEAN, hasDefault = true, defaultBoolean = true)
- String KEY_GZIP_COMPRESSING = "gzip_compressing";
@Preference(type = BOOLEAN)
String KEY_IGNORE_SSL_ERROR = "ignore_ssl_error";
@Preference(type = STRING)
diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableDirectMessage.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableDirectMessage.java
index 71255179e..7e5d3a050 100644
--- a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableDirectMessage.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableDirectMessage.java
@@ -34,8 +34,8 @@ import org.mariotaku.twidere.util.TwitterContentUtils;
import java.util.Comparator;
import java.util.Date;
-import twitter4j.DirectMessage;
-import twitter4j.User;
+import org.mariotaku.twidere.api.twitter.model.DirectMessage;
+import org.mariotaku.twidere.api.twitter.model.User;
import static org.mariotaku.twidere.util.HtmlEscapeHelper.toPlainText;
import static org.mariotaku.twidere.util.content.ContentValuesUtils.getAsBoolean;
diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableLocation.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableLocation.java
index 5b3478958..69d70a99d 100644
--- a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableLocation.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableLocation.java
@@ -29,7 +29,7 @@ import com.bluelinelabs.logansquare.annotation.JsonObject;
import org.mariotaku.twidere.util.ParseUtils;
-import twitter4j.GeoLocation;
+import org.mariotaku.twidere.api.twitter.model.GeoLocation;
@JsonObject
public class ParcelableLocation implements Parcelable {
diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableMedia.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableMedia.java
index a4ccb29bb..1d1eb5502 100644
--- a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableMedia.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableMedia.java
@@ -22,17 +22,17 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import twitter4j.CardEntity;
-import twitter4j.CardEntity.BindingValue;
-import twitter4j.CardEntity.ImageValue;
-import twitter4j.CardEntity.StringValue;
-import twitter4j.EntitySupport;
-import twitter4j.ExtendedEntitySupport;
-import twitter4j.MediaEntity;
-import twitter4j.MediaEntity.Size;
-import twitter4j.MediaEntity.Type;
-import twitter4j.Status;
-import twitter4j.UrlEntity;
+import org.mariotaku.twidere.api.twitter.model.CardEntity;
+import org.mariotaku.twidere.api.twitter.model.CardEntity.BindingValue;
+import org.mariotaku.twidere.api.twitter.model.CardEntity.ImageValue;
+import org.mariotaku.twidere.api.twitter.model.CardEntity.StringValue;
+import org.mariotaku.twidere.api.twitter.model.EntitySupport;
+import org.mariotaku.twidere.api.twitter.model.ExtendedEntitySupport;
+import org.mariotaku.twidere.api.twitter.model.MediaEntity;
+import org.mariotaku.twidere.api.twitter.model.MediaEntity.Size;
+import org.mariotaku.twidere.api.twitter.model.MediaEntity.Type;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.model.UrlEntity;
@SuppressWarnings("unused")
@JsonObject
diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableStatus.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableStatus.java
index c00836cc8..4be2e6c2a 100644
--- a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableStatus.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableStatus.java
@@ -43,15 +43,15 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
-import twitter4j.CardEntity;
-import twitter4j.CardEntity.BindingValue;
-import twitter4j.CardEntity.BooleanValue;
-import twitter4j.CardEntity.ImageValue;
-import twitter4j.CardEntity.StringValue;
-import twitter4j.CardEntity.UserValue;
-import twitter4j.Place;
-import twitter4j.Status;
-import twitter4j.User;
+import org.mariotaku.twidere.api.twitter.model.CardEntity;
+import org.mariotaku.twidere.api.twitter.model.CardEntity.BindingValue;
+import org.mariotaku.twidere.api.twitter.model.CardEntity.BooleanValue;
+import org.mariotaku.twidere.api.twitter.model.CardEntity.ImageValue;
+import org.mariotaku.twidere.api.twitter.model.CardEntity.StringValue;
+import org.mariotaku.twidere.api.twitter.model.CardEntity.UserValue;
+import org.mariotaku.twidere.api.twitter.model.Place;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.model.User;
@SuppressWarnings("unused")
@JsonObject
diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableUser.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableUser.java
index 05b43f8ba..bd5578c8f 100644
--- a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableUser.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableUser.java
@@ -35,8 +35,8 @@ import org.mariotaku.twidere.util.HtmlEscapeHelper;
import org.mariotaku.twidere.util.ParseUtils;
import org.mariotaku.twidere.util.TwitterContentUtils;
-import twitter4j.UrlEntity;
-import twitter4j.User;
+import org.mariotaku.twidere.api.twitter.model.UrlEntity;
+import org.mariotaku.twidere.api.twitter.model.User;
@JsonObject
public class ParcelableUser implements Parcelable, Comparable {
diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableUserList.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableUserList.java
index abb821187..9c66dc384 100644
--- a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableUserList.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableUserList.java
@@ -26,8 +26,8 @@ import android.support.annotation.NonNull;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
-import twitter4j.User;
-import twitter4j.UserList;
+import org.mariotaku.twidere.api.twitter.model.User;
+import org.mariotaku.twidere.api.twitter.model.UserList;
@JsonObject
public class ParcelableUserList implements Parcelable, Comparable {
diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableUserMention.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableUserMention.java
index eef472f98..d782dd852 100644
--- a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableUserMention.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableUserMention.java
@@ -30,8 +30,8 @@ import com.bluelinelabs.logansquare.annotation.JsonObject;
import java.io.IOException;
import java.util.List;
-import twitter4j.Status;
-import twitter4j.UserMentionEntity;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.model.UserMentionEntity;
@JsonObject
public class ParcelableUserMention implements Parcelable {
diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/util/ContentValuesCreator.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/util/ContentValuesCreator.java
index 9cdcc5b8a..6d3119739 100644
--- a/twidere.component.common/src/main/java/org/mariotaku/twidere/util/ContentValuesCreator.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/util/ContentValuesCreator.java
@@ -54,16 +54,16 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import twitter4j.DirectMessage;
-import twitter4j.GeoLocation;
-import twitter4j.Place;
-import twitter4j.Relationship;
-import twitter4j.SavedSearch;
-import twitter4j.Status;
-import twitter4j.Trend;
-import twitter4j.Trends;
-import twitter4j.UrlEntity;
-import twitter4j.User;
+import org.mariotaku.twidere.api.twitter.model.DirectMessage;
+import org.mariotaku.twidere.api.twitter.model.GeoLocation;
+import org.mariotaku.twidere.api.twitter.model.Place;
+import org.mariotaku.twidere.api.twitter.model.Relationship;
+import org.mariotaku.twidere.api.twitter.model.SavedSearch;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.model.Trend;
+import org.mariotaku.twidere.api.twitter.model.Trends;
+import org.mariotaku.twidere.api.twitter.model.UrlEntity;
+import org.mariotaku.twidere.api.twitter.model.User;
import static org.mariotaku.twidere.util.HtmlEscapeHelper.toPlainText;
diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/util/MediaPreviewUtils.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/util/MediaPreviewUtils.java
index 4e47aa2a9..53a4a0807 100644
--- a/twidere.component.common/src/main/java/org/mariotaku/twidere/util/MediaPreviewUtils.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/util/MediaPreviewUtils.java
@@ -41,9 +41,9 @@ import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import twitter4j.MediaEntity;
-import twitter4j.Status;
-import twitter4j.UrlEntity;
+import org.mariotaku.twidere.api.twitter.model.MediaEntity;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.model.UrlEntity;
import static android.text.TextUtils.isEmpty;
diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/util/TwitterContentUtils.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/util/TwitterContentUtils.java
index 6965d3d91..53c63f286 100644
--- a/twidere.component.common/src/main/java/org/mariotaku/twidere/util/TwitterContentUtils.java
+++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/util/TwitterContentUtils.java
@@ -28,13 +28,13 @@ import org.mariotaku.twidere.model.ConsumerKeyType;
import java.nio.charset.Charset;
import java.util.zip.CRC32;
-import twitter4j.DirectMessage;
-import twitter4j.EntitySupport;
-import twitter4j.MediaEntity;
-import twitter4j.Status;
-import twitter4j.UrlEntity;
-import twitter4j.User;
-import twitter4j.UserMentionEntity;
+import org.mariotaku.twidere.api.twitter.model.DirectMessage;
+import org.mariotaku.twidere.api.twitter.model.EntitySupport;
+import org.mariotaku.twidere.api.twitter.model.MediaEntity;
+import org.mariotaku.twidere.api.twitter.model.Status;
+import org.mariotaku.twidere.api.twitter.model.UrlEntity;
+import org.mariotaku.twidere.api.twitter.model.User;
+import org.mariotaku.twidere.api.twitter.model.UserMentionEntity;
import static org.mariotaku.twidere.util.HtmlEscapeHelper.toPlainText;
diff --git a/twidere.component.twitter4j.streaming/.gitignore b/twidere.component.twitter4j.streaming/.gitignore
deleted file mode 100644
index 796b96d1c..000000000
--- a/twidere.component.twitter4j.streaming/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/twidere.component.twitter4j.streaming/build.gradle b/twidere.component.twitter4j.streaming/build.gradle
deleted file mode 100644
index 47059764a..000000000
--- a/twidere.component.twitter4j.streaming/build.gradle
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Twidere - Twitter client for Android
- *
- * Copyright (C) 2012-2015 Mariotaku Lee
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-apply plugin: 'com.android.library'
-apply from: rootProject.file('global.gradle')
-
-android {
- defaultConfig {
- minSdkVersion 14
- targetSdkVersion 22
- versionCode 1
- versionName "1.0"
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
-}
-
-dependencies {
- compile project(':twidere.component.twitter4j')
- compile fileTree(dir: 'libs', include: ['*.jar'])
-}
diff --git a/twidere.component.twitter4j.streaming/proguard-rules.pro b/twidere.component.twitter4j.streaming/proguard-rules.pro
deleted file mode 100644
index ee5b46f04..000000000
--- a/twidere.component.twitter4j.streaming/proguard-rules.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in /Users/mariotaku/Tools/android-sdk/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the proguardFiles
-# directive in build.gradle.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/twidere.component.twitter4j.streaming/src/androidTest/java/org/mariotaku/twidere/library/twitter4j/streaming/ApplicationTest.java b/twidere.component.twitter4j.streaming/src/androidTest/java/org/mariotaku/twidere/library/twitter4j/streaming/ApplicationTest.java
deleted file mode 100644
index 37041d3c9..000000000
--- a/twidere.component.twitter4j.streaming/src/androidTest/java/org/mariotaku/twidere/library/twitter4j/streaming/ApplicationTest.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Twidere - Twitter client for Android
- *
- * Copyright (C) 2012-2015 Mariotaku Lee
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package org.mariotaku.twidere.library.twitter4j.streaming;
-
-import android.app.Application;
-import android.test.ApplicationTestCase;
-
-/**
- * Testing Fundamentals
- */
-public class ApplicationTest extends ApplicationTestCase {
- public ApplicationTest() {
- super(Application.class);
- }
-}
\ No newline at end of file
diff --git a/twidere.component.twitter4j.streaming/src/main/AndroidManifest.xml b/twidere.component.twitter4j.streaming/src/main/AndroidManifest.xml
deleted file mode 100644
index 3e5a30de4..000000000
--- a/twidere.component.twitter4j.streaming/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/ConnectionLifeCycleListener.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/ConnectionLifeCycleListener.java
deleted file mode 100644
index e29ee9668..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/ConnectionLifeCycleListener.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.7
- */
-public interface ConnectionLifeCycleListener {
- /**
- * called before thread gets cleaned up
- */
- void onCleanUp();
-
- /**
- * called after connection was established
- */
- void onConnect();
-
- /**
- * called after connection was disconnected
- */
- void onDisconnect();
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/ControlStreamInfo.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/ControlStreamInfo.java
deleted file mode 100644
index a90245018..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/ControlStreamInfo.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- * Copyright (C) 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-import static twitter4j.internal.util.InternalParseUtil.getBoolean;
-import static twitter4j.internal.util.InternalParseUtil.getRawString;
-
-import java.io.Serializable;
-import java.util.Arrays;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * @author Yusuke Yamamoto - yusuke at twitter.com
- * @since Twitter4J 2.2.6
- */
-public final class ControlStreamInfo implements Serializable {
- private static final long serialVersionUID = -6761659771734942177L;
- private final StreamController.User[] users;
- private final boolean includeFollowingsActivity;
- private final boolean includeUserChanges;
- private final String replies;
- private final String with;
- private transient final StreamController controller;
-
- /* package */ControlStreamInfo(final StreamController controller, final JSONObject json) throws TwitterException {
- this.controller = controller;
- try {
- final JSONObject info = json.getJSONObject("info");
- includeFollowingsActivity = getBoolean("include_followings_activity", info);
- includeUserChanges = getBoolean("include_user_changes", info);
- replies = getRawString("replies", info);
- with = getRawString("with", info);
- final JSONArray usersJSON = info.getJSONArray("users");
- users = new StreamController.User[usersJSON.length()];
- for (int i = 0; i < usersJSON.length(); i++) {
- users[i] = this.controller.createUser(usersJSON.getJSONObject(i));
- }
-
- } catch (final JSONException e) {
- throw new TwitterException(e);
- }
-
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- final ControlStreamInfo that = (ControlStreamInfo) o;
-
- if (includeFollowingsActivity != that.includeFollowingsActivity) return false;
- if (includeUserChanges != that.includeUserChanges) return false;
- if (replies != null ? !replies.equals(that.replies) : that.replies != null) return false;
- if (!Arrays.equals(users, that.users)) return false;
- if (with != null ? !with.equals(that.with) : that.with != null) return false;
-
- return true;
- }
-
- public StreamController.User[] getUsers() {
- return users;
- }
-
- @Override
- public int hashCode() {
- int result = users != null ? Arrays.hashCode(users) : 0;
- result = 31 * result + (includeFollowingsActivity ? 1 : 0);
- result = 31 * result + (includeUserChanges ? 1 : 0);
- result = 31 * result + (replies != null ? replies.hashCode() : 0);
- result = 31 * result + (with != null ? with.hashCode() : 0);
- return result;
- }
-
- public boolean isIncludeFollowingsActivity() {
- return includeFollowingsActivity;
- }
-
- public boolean isIncludeUserChanges() {
- return includeUserChanges;
- }
-
- public String isReplies() {
- return replies;
- }
-
- public String isWith() {
- return with;
- }
-
- @Override
- public String toString() {
- return "ControlStreamInfo{" + "users=" + (users == null ? null : Arrays.asList(users))
- + ", includeFollowingsActivity=" + includeFollowingsActivity + ", includeUserChanges="
- + includeUserChanges + ", replies='" + replies + '\'' + ", with='" + with + '\'' + '}';
- }
-}
\ No newline at end of file
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/FilterQuery.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/FilterQuery.java
deleted file mode 100644
index e6a363b74..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/FilterQuery.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import twitter4j.http.HttpParameter;
-import twitter4j.internal.util.InternalStringUtil;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.2
- */
-public final class FilterQuery implements java.io.Serializable {
- private static final long serialVersionUID = 430966623248982833L;
- private int count;
- private long[] follow;
- private String[] track;
- private double[][] locations;
-
- /**
- * Creates a new FilterQuery
- */
- public FilterQuery() {
- count = 0;
- follow = null;
- track = null;
- locations = null;
- }
-
- /**
- * Creates a new FilterQuery
- *
- * @param count Indicates the number of previous statuses to stream before
- * transitioning to the live stream.
- * @param follow Specifies the users, by ID, to receive public tweets from.
- */
- public FilterQuery(final int count, final long[] follow) {
- this();
- this.count = count;
- this.follow = follow;
- }
-
- /**
- * Creates a new FilterQuery
- *
- * @param count Indicates the number of previous statuses to stream before
- * transitioning to the live stream.
- * @param follow Specifies the users, by ID, to receive public tweets from.
- * @param track Specifies keywords to track.
- */
- public FilterQuery(final int count, final long[] follow, final String[] track) {
- this();
- this.count = count;
- this.follow = follow;
- this.track = track;
- }
-
- /**
- * Creates a new FilterQuery
- *
- * @param count Indicates the number of previous statuses to stream before
- * transitioning to the live stream.
- * @param follow Specifies the users, by ID, to receive public tweets from.
- * @param track Specifies keywords to track.
- * @param locations Specifies the locations to track. 2D array
- */
- public FilterQuery(final int count, final long[] follow, final String[] track, final double[][] locations) {
- this.count = count;
- this.follow = follow;
- this.track = track;
- this.locations = locations;
- }
-
- /**
- * Creates a new FilterQuery
- *
- * @param follow Specifies the users, by ID, to receive public tweets from.
- */
- public FilterQuery(final long[] follow) {
- this();
- count = 0;
- this.follow = follow;
- }
-
- /**
- * Sets count
- *
- * @param count Indicates the number of previous statuses to stream before
- * transitioning to the live stream.
- * @return this instance
- */
- public FilterQuery count(final int count) {
- this.count = count;
- return this;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- final FilterQuery that = (FilterQuery) o;
-
- if (count != that.count) return false;
- if (!Arrays.equals(follow, that.follow)) return false;
- if (!Arrays.equals(track, that.track)) return false;
-
- return true;
- }
-
- /**
- * Sets follow
- *
- * @param follow Specifies the users, by ID, to receive public tweets from.
- * @return this instance
- */
- public FilterQuery follow(final long[] follow) {
- this.follow = follow;
- return this;
- }
-
- @Override
- public int hashCode() {
- int result = count;
- result = 31 * result + (follow != null ? Arrays.hashCode(follow) : 0);
- result = 31 * result + (track != null ? Arrays.hashCode(track) : 0);
- return result;
- }
-
- /**
- * Sets locations
- *
- * @param locations Specifies the locations to track. 2D array
- * @return this instance
- */
- public FilterQuery locations(final double[][] locations) {
- this.locations = locations;
- return this;
- }
-
- @Override
- public String toString() {
- return "FilterQuery{" + "count=" + count + ", follow=" + Arrays.toString(follow) + ", track="
- + (track == null ? null : Arrays.asList(track)) + ", locations="
- + (locations == null ? null : Arrays.asList(locations)) + '}';
- }
-
- /**
- * Sets track
- *
- * @param track Specifies keywords to track.
- * @return this instance
- */
- public FilterQuery track(final String[] track) {
- this.track = track;
- return this;
- }
-
- private String toLocationsString(final double[][] keywords) {
- final StringBuilder buf = new StringBuilder(20 * keywords.length * 2);
- for (final double[] keyword : keywords) {
- if (0 != buf.length()) {
- buf.append(",");
- }
- buf.append(keyword[0]);
- buf.append(",");
- buf.append(keyword[1]);
- }
- return buf.toString();
- }
-
- /* package */HttpParameter[] asHttpParameterArray(final HttpParameter stallWarningsParam) {
- final ArrayList params = new ArrayList();
-
- params.add(new HttpParameter("count", count));
- if (follow != null && follow.length > 0) {
- params.add(new HttpParameter("follow", InternalStringUtil.join(follow)));
- }
- if (track != null && track.length > 0) {
- params.add(new HttpParameter("track", InternalStringUtil.join(track)));
- }
- if (locations != null && locations.length > 0) {
- params.add(new HttpParameter("locations", toLocationsString(locations)));
- }
- params.add(stallWarningsParam);
- final HttpParameter[] paramArray = new HttpParameter[params.size()];
- return params.toArray(paramArray);
- }
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/RawStreamListener.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/RawStreamListener.java
deleted file mode 100644
index beb1f16cb..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/RawStreamListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package twitter4j;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 3.0.2
- */
-public interface RawStreamListener extends StreamListener {
- void onMessage(String rawString);
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/SiteStreamsAdapter.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/SiteStreamsAdapter.java
deleted file mode 100644
index 6287c2ec4..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/SiteStreamsAdapter.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package twitter4j;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.8
- */
-public class SiteStreamsAdapter implements SiteStreamsListener {
- @Override
- public void onBlock(final long forUser, final User source, final User blockedUser) {
- }
-
- @Override
- public void onDeletionNotice(final long forUser, final long directMessageId, final long userId) {
- }
-
- @Override
- public void onDeletionNotice(final long forUser, final StatusDeletionNotice statusDeletionNotice) {
- }
-
- @Override
- public void onDirectMessage(final long forUser, final DirectMessage directMessage) {
- }
-
- @Override
- public void onDisconnectionNotice(final String screenName) {
- }
-
- @Override
- public void onException(final Exception ex) {
- }
-
- @Override
- public void onFavorite(final long forUser, final User source, final User target, final Status favoritedStatus) {
- }
-
- @Override
- public void onFollow(final long forUser, final User source, final User followedUser) {
- }
-
- @Override
- public void onFriendList(final long forUser, final long[] friendIds) {
- }
-
- @Override
- public void onStatus(final long forUser, final Status status) {
- }
-
- @Override
- public void onUnblock(final long forUser, final User source, final User unblockedUser) {
- }
-
- @Override
- public void onUnfavorite(final long forUser, final User source, final User target, final Status unfavoritedStatus) {
- }
-
- @Override
- public void onUnfollow(final long forUser, final User source, final User followedUser) {
- }
-
- @Override
- public void onUserListCreation(final long forUser, final User listOwner, final UserList list) {
- }
-
- @Override
- public void onUserListDeletion(final long forUser, final User listOwner, final UserList list) {
- }
-
- @Override
- public void onUserListMemberAddition(final long forUser, final User addedUser, final User listOwner,
- final UserList list) {
- }
-
- @Override
- public void onUserListMemberDeletion(final long forUser, final User deletedUser, final User listOwner,
- final UserList list) {
- }
-
- @Override
- public void onUserListSubscription(final long forUser, final User subscriber, final User listOwner,
- final UserList list) {
- }
-
- @Override
- public void onUserListUnsubscription(final long forUser, final User subscriber, final User listOwner,
- final UserList list) {
- }
-
- @Override
- public void onUserListUpdate(final long forUser, final User listOwner, final UserList list) {
- }
-
- @Override
- public void onUserProfileUpdate(final long forUser, final User updatedUser) {
- }
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/SiteStreamsImpl.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/SiteStreamsImpl.java
deleted file mode 100755
index fad0cd4ff..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/SiteStreamsImpl.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import twitter4j.conf.StreamConfiguration;
-import twitter4j.http.HttpResponse;
-import twitter4j.internal.async.Dispatcher;
-import twitter4j.internal.util.InternalParseUtil;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.8
- */
-class SiteStreamsImpl extends StatusStreamBase {
-
- private final StreamController cs;
-
- private static ThreadLocal forUser = new ThreadLocal() {
- @Override
- protected Integer initialValue() {
- return 0;
- }
- };
-
- protected static final RawStreamListener[] EMPTY = new RawStreamListener[0];
-
- /* package */SiteStreamsImpl(final Dispatcher dispatcher, final HttpResponse response,
- final StreamConfiguration conf, final StreamController cs) throws IOException {
- super(dispatcher, response, conf);
- this.cs = cs;
- }
-
- /* package */SiteStreamsImpl(final Dispatcher dispatcher, final InputStream stream, final StreamConfiguration conf,
- final StreamController cs) throws IOException {
- super(dispatcher, stream, conf);
- this.cs = cs;
- }
-
- @Override
- public void next(final StatusListener listener) throws TwitterException {
- handleNextElement(new StatusListener[] { listener }, EMPTY);
- }
-
- @Override
- public void next(final StreamListener[] listeners, final RawStreamListener[] rawStreamListeners)
- throws TwitterException {
- handleNextElement(listeners, rawStreamListeners);
- }
-
- @Override
- public void onDisconnectionNotice(final String line, final StreamListener[] listeners) {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onDisconnectionNotice(line);
- }
- }
-
- @Override
- public void onException(final Exception ex, final StreamListener[] listeners) {
- for (final StreamListener listener : listeners) {
- listener.onException(ex);
- }
- }
-
- @Override
- protected void onBlock(final JSONObject source, final JSONObject target, final StreamListener[] listeners)
- throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onBlock(forUser.get(), asUser(source), asUser(target));
- }
- }
-
- @Override
- protected void onDelete(final JSONObject json, final StreamListener[] listeners) throws JSONException {
- final JSONObject deletionNotice = json.getJSONObject("delete");
- if (deletionNotice.has("status")) {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onDeletionNotice(forUser.get(), new StatusDeletionNoticeImpl(
- deletionNotice.getJSONObject("status")));
- }
- } else {
- final JSONObject directMessage = deletionNotice.getJSONObject("direct_message");
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onDeletionNotice(forUser.get(),
- InternalParseUtil.getInt("id", directMessage),
- InternalParseUtil.getLong("user_id", directMessage));
- }
- }
- }
-
- @Override
- protected void onDirectMessage(final JSONObject json, final StreamListener[] listeners) throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onDirectMessage(forUser.get(), asDirectMessage(json));
- }
- }
-
- @Override
- protected void onFavorite(final JSONObject source, final JSONObject target, final JSONObject targetObject,
- final StreamListener[] listeners) throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onFavorite(forUser.get(), asUser(source), asUser(target),
- asStatus(targetObject));
- }
- }
-
- @Override
- protected void onFollow(final JSONObject source, final JSONObject target, final StreamListener[] listeners)
- throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onFollow(forUser.get(), asUser(source), asUser(target));
- }
- }
-
- @Override
- protected void onFriends(final JSONObject json, final StreamListener[] listeners) throws TwitterException,
- JSONException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onFriendList(forUser.get(), asFriendList(json));
- }
- }
-
- @Override
- protected void onMessage(final String rawString, final RawStreamListener[] listeners) throws TwitterException {
- for (final RawStreamListener listener : listeners) {
- listener.onMessage(rawString);
- }
- }
-
- @Override
- protected void onStatus(final JSONObject json, final StreamListener[] listeners) throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onStatus(forUser.get(), asStatus(json));
- }
- }
-
- @Override
- protected void onUnblock(final JSONObject source, final JSONObject target, final StreamListener[] listeners)
- throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onUnblock(forUser.get(), asUser(source), asUser(target));
- }
- }
-
- @Override
- protected void onUnfavorite(final JSONObject source, final JSONObject target, final JSONObject targetObject,
- final StreamListener[] listeners) throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onUnfavorite(forUser.get(), asUser(source), asUser(target),
- asStatus(targetObject));
- }
- }
-
- @Override
- protected void onUnfollow(final JSONObject source, final JSONObject target, final StreamListener[] listeners)
- throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onUnfollow(forUser.get(), asUser(source), asUser(target));
- }
- }
-
- @Override
- protected void onUserListCreation(final JSONObject source, final JSONObject userList,
- final StreamListener[] listeners) throws TwitterException, JSONException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onUserListCreation(forUser.get(), asUser(source), asUserList(userList));
- }
- }
-
- @Override
- protected void onUserListDestroyed(final JSONObject source, final JSONObject userList,
- final StreamListener[] listeners) throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onUserListDeletion(forUser.get(), asUser(source), asUserList(userList));
- }
- }
-
- @Override
- protected void onUserListMemberAddition(final JSONObject addedMember, final JSONObject owner,
- final JSONObject userList, final StreamListener[] listeners) throws TwitterException, JSONException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onUserListMemberAddition(forUser.get(), asUser(addedMember),
- asUser(owner), asUserList(userList));
- }
- }
-
- @Override
- protected void onUserListMemberDeletion(final JSONObject deletedMember, final JSONObject owner,
- final JSONObject userList, final StreamListener[] listeners) throws TwitterException, JSONException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onUserListMemberDeletion(forUser.get(), asUser(deletedMember),
- asUser(owner), asUserList(userList));
- }
- }
-
- @Override
- protected void onUserListSubscription(final JSONObject source, final JSONObject owner, final JSONObject userList,
- final StreamListener[] listeners) throws TwitterException, JSONException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onUserListSubscription(forUser.get(), asUser(source), asUser(owner),
- asUserList(userList));
- }
- }
-
- @Override
- protected void onUserListUnsubscription(final JSONObject source, final JSONObject owner, final JSONObject userList,
- final StreamListener[] listeners) throws TwitterException, JSONException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onUserListUnsubscription(forUser.get(), asUser(source), asUser(owner),
- asUserList(userList));
- }
- }
-
- @Override
- protected void onUserListUpdated(final JSONObject source, final JSONObject userList,
- final StreamListener[] listeners) throws TwitterException, JSONException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onUserListUpdate(forUser.get(), asUser(source), asUserList(userList));
- }
- }
-
- @Override
- protected void onUserUpdate(final JSONObject source, final JSONObject target, final StreamListener[] listeners)
- throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((SiteStreamsListener) listener).onUserProfileUpdate(forUser.get(), asUser(source));
- }
- }
-
- @Override
- protected String parseLine(final String line) {
- if ("".equals(line) || null == line) return line;
- final int userIdEnd = line.indexOf(',', 12);
- // in the documentation for_user is not quoted, but actually it is
- // quoted
- if (cs.getControlURI() == null && line.charAt(2) == 'c' && line.charAt(3) == 'o' && line.charAt(4) == 'n') {
- // control endpoint uri
- // https://dev.twitter.com/docs/streaming-api/control-streams
- JSONObject control = null;
- try {
- control = new JSONObject(line);
- cs.setControlURI(CONF.getSiteStreamBaseURL()
- + control.getJSONObject("control").getString("control_uri"));
- logger.info("control_uri: " + cs.getControlURI());
- } catch (final JSONException e) {
- logger.warn("received unexpected event:" + line);
- }
- return null;
- }
-
- if (line.charAt(2) == 'd') // disconnection notice
- // {"disconnect":{"code":3,"stream_name":"yusuke-sitestream6139-yusuke","reason":"control request for yusuke-sitestream6139 106.171.17.29 /1.1/site.json sitestream"}}
- return line;
- if (line.charAt(12) == '"') {
- forUser.set(Integer.parseInt(line.substring(13, userIdEnd - 1)));
- } else {
- forUser.set(Integer.parseInt(line.substring(12, userIdEnd)));
- }
- return line.substring(userIdEnd + 11, line.length() - 1);
- }
-
-}
\ No newline at end of file
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/SiteStreamsListener.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/SiteStreamsListener.java
deleted file mode 100644
index 33a91109f..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/SiteStreamsListener.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Twidere - Twitter client for Android
- *
- * Copyright (C) 2012-2015 Mariotaku Lee
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package twitter4j;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.8
- */
-public interface SiteStreamsListener extends StreamListener {
- /**
- * @param forUser the user id to whom sent the event
- * @param source
- * @param blockedUser
- */
- void onBlock(long forUser, User source, User blockedUser);
-
- void onDeletionNotice(long forUser, long directMessageId, long userId);
-
- void onDeletionNotice(long forUser, StatusDeletionNotice statusDeletionNotice);
-
- /**
- * @param forUser the user id to whom sent the event
- * @param directMessage
- */
- void onDirectMessage(long forUser, DirectMessage directMessage);
-
- /**
- * callback method for {@link twitter4j.StreamController#removeUsers(long[])}
- */
- void onDisconnectionNotice(String line);
-
- @Override
- void onException(Exception ex);
-
- /**
- * @param forUser the user id to whom sent the event
- * @param source
- * @param target
- * @param favoritedStatus
- */
- void onFavorite(long forUser, User source, User target, Status favoritedStatus);
-
- /**
- * @param forUser the user id to whom sent the event
- * @param source
- * @param followedUser
- */
- void onFollow(long forUser, User source, User followedUser);
-
- /**
- * @param forUser the user id to whom sent the event
- * @param friendIds
- */
- void onFriendList(long forUser, long[] friendIds);
-
- void onStatus(long forUser, Status status);
-
- /**
- * @param forUser the user id to whom sent the event
- * @param source
- * @param unblockedUser
- */
- void onUnblock(long forUser, User source, User unblockedUser);
-
- /**
- * @param forUser the user id to whom sent the event
- * @param target
- * @param unfavoritedStatus
- */
- void onUnfavorite(long forUser, User source, User target, Status unfavoritedStatus);
-
- /**
- * @param forUser the user id to whom sent the event
- * @param source
- * @param unfollowedUser
- * @since Twitter4J 2.1.11
- */
- void onUnfollow(long forUser, User source, User unfollowedUser);
-
- /**
- * @param forUser the user id to whom sent the event
- * @param listOwner
- * @param list
- */
- void onUserListCreation(long forUser, User listOwner, UserList list);
-
- /**
- * @param forUser the user id to whom sent the event
- * @param listOwner
- * @param list
- */
- void onUserListDeletion(long forUser, User listOwner, UserList list);
-
- /**
- * @param forUser the user id to whom sent the event
- * @param addedMember
- * @param listOwner
- * @param list
- */
- void onUserListMemberAddition(long forUser, User addedMember, User listOwner, UserList list);
-
- /**
- * @param forUser the user id to whom sent the event
- * @param deletedMember
- * @param listOwner
- * @param list
- */
- void onUserListMemberDeletion(long forUser, User deletedMember, User listOwner, UserList list);
-
- /**
- * @param forUser the user id to whom sent the event
- * @param subscriber
- * @param listOwner
- * @param list
- */
- void onUserListSubscription(long forUser, User subscriber, User listOwner, UserList list);
-
- /**
- * @param forUser the user id to whom sent the event
- * @param subscriber
- * @param listOwner
- * @param list
- */
- void onUserListUnsubscription(long forUser, User subscriber, User listOwner, UserList list);
-
- /**
- * @param forUser the user id to whom sent the event
- * @param listOwner
- * @param list
- */
- void onUserListUpdate(long forUser, User listOwner, UserList list);
-
- /**
- * @param forUser the user id to whom sent the event
- * @param updatedUser updated user
- * @since Twitter4J 2.1.9
- */
- void onUserProfileUpdate(long forUser, User updatedUser);
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StallWarning.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StallWarning.java
deleted file mode 100644
index 15926a6e8..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StallWarning.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- * Copyright (C) 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package twitter4j;
-
-import static twitter4j.internal.util.InternalParseUtil.getInt;
-import static twitter4j.internal.util.InternalParseUtil.getRawString;
-
-import java.io.Serializable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * @author Yusuke Yamamoto - yusuke at twitter.com
- * @since Twitter4J 3.0.0
- */
-public final class StallWarning implements Serializable {
- private static final long serialVersionUID = 7387184309206228363L;
- private final String code;
- private final String message;
- private final int percentFull;
-
- StallWarning(final JSONObject json) throws JSONException {
- final JSONObject warning = json.getJSONObject("warning");
- code = getRawString("code", warning);
- message = getRawString("message", warning);
- percentFull = getInt("percent_full", warning);
-
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- final StallWarning that = (StallWarning) o;
-
- if (percentFull != that.percentFull) return false;
- if (code != null ? !code.equals(that.code) : that.code != null) return false;
- if (message != null ? !message.equals(that.message) : that.message != null) return false;
-
- return true;
- }
-
- public String getCode() {
- return code;
- }
-
- public String getMessage() {
- return message;
- }
-
- public int getPercentFull() {
- return percentFull;
- }
-
- @Override
- public int hashCode() {
- int result = code != null ? code.hashCode() : 0;
- result = 31 * result + (message != null ? message.hashCode() : 0);
- result = 31 * result + percentFull;
- return result;
- }
-
- @Override
- public String toString() {
- return "StallWarning{" + "code='" + code + '\'' + ", message='" + message + '\'' + ", percentFull="
- + percentFull + '}';
- }
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusAdapter.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusAdapter.java
deleted file mode 100644
index c154e9f5c..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusAdapter.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-/**
- * @author yusuke at mac.com
- * @since Twitter4J 2.1.3
- */
-public class StatusAdapter implements StatusListener {
- @Override
- public void onDeletionNotice(final StatusDeletionNotice statusDeletionNotice) {
- }
-
- @Override
- public void onException(final Exception ex) {
- }
-
- @Override
- public void onScrubGeo(final long userId, final long upToStatusId) {
- }
-
- @Override
- public void onStallWarning(final StallWarning warning) {
- }
-
- @Override
- public void onStatus(final Status status) {
- }
-
- @Override
- public void onTrackLimitationNotice(final int numberOfLimitedStatuses) {
- }
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusDeletionNotice.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusDeletionNotice.java
deleted file mode 100644
index e93d1ca20..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusDeletionNotice.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-/**
- * A data class representing Status deletionNotice
- * Clients are urged to honor deletionNotice requests and discard deleted
- * statuses immediately. At times, status deletionNotice messages may arrive
- * before the status. Even in this case, the late arriving status should be
- * deleted from your backing store.
- *
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.0
- */
-public interface StatusDeletionNotice extends Comparable, java.io.Serializable {
- long getStatusId();
-
- long getUserId();
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusDeletionNoticeImpl.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusDeletionNoticeImpl.java
deleted file mode 100644
index 4853ffa17..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusDeletionNoticeImpl.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-import org.json.JSONObject;
-
-import twitter4j.internal.util.InternalParseUtil;
-
-/**
- * StatusDeletionNotice implementation. This class is NOT intended to be
- * extended but left non-final for the ease of mock testing.
- *
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.2
- */
-class StatusDeletionNoticeImpl implements StatusDeletionNotice, java.io.Serializable {
-
- private final long statusId;
- private final long userId;
- private static final long serialVersionUID = 1723338404242596062L;
-
- /* package */StatusDeletionNoticeImpl(final JSONObject status) {
- statusId = InternalParseUtil.getLong("id", status);
- userId = InternalParseUtil.getLong("user_id", status);
- }
-
- @Override
- public int compareTo(final StatusDeletionNotice that) {
- final long delta = statusId - that.getStatusId();
- if (delta < Integer.MIN_VALUE)
- return Integer.MIN_VALUE;
- else if (delta > Integer.MAX_VALUE) return Integer.MAX_VALUE;
- return (int) delta;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- final StatusDeletionNoticeImpl that = (StatusDeletionNoticeImpl) o;
-
- if (statusId != that.statusId) return false;
- if (userId != that.userId) return false;
-
- return true;
- }
-
- @Override
- public long getStatusId() {
- return statusId;
- }
-
- @Override
- public long getUserId() {
- return userId;
- }
-
- @Override
- public int hashCode() {
- int result = (int) (statusId ^ statusId >>> 32);
- result = 31 * result + (int) (userId ^ userId >>> 32);
- return result;
- }
-
- @Override
- public String toString() {
- return "StatusDeletionNoticeImpl{" + "statusId=" + statusId + ", userId=" + userId + '}';
- }
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusListener.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusListener.java
deleted file mode 100644
index 4e146a707..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusListener.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.0.4
- */
-public interface StatusListener extends StreamListener {
- /**
- * Called upon deletionNotice notices. Clients are urged to honor
- * deletionNotice requests and discard deleted statuses immediately. At
- * times, status deletionNotice messages may arrive before the status. Even
- * in this case, the late arriving status should be deleted from your
- * backing store.
- *
- * @param statusDeletionNotice the deletionNotice notice
- * @see Streaming
- * API Concepts | Twitter Developers
- * @since Twitter4J 2.1.0
- */
- void onDeletionNotice(StatusDeletionNotice statusDeletionNotice);
-
- /**
- * Called upon location deletion messages. Clients are urged to honor
- * deletion requests and remove appropriate geolocation information from
- * both the display and your backing store immediately. Note that in some
- * cases the location deletion message may arrive before a tweet that lies
- * within the deletion range arrives. You should still strip the location
- * data.
- *
- * @param userId user id
- * @param upToStatusId up to status id
- * @since Twitter4J 2.1.9
- */
- void onScrubGeo(long userId, long upToStatusId);
-
- /**
- * Called when receiving stall warnings.
- *
- * @param warning StallWaning
- * @see Streaming
- * API request parameters - stall_warnings
- * @since Twitter4J 3.0.0
- */
- void onStallWarning(StallWarning warning);
-
- void onStatus(Status status);
-
- /**
- * This notice will be sent each time a limited stream becomes unlimited.
- * If this number is high and or rapidly increasing, it is an indication
- * that your predicate is too broad, and you should consider a predicate
- * with higher selectivity.
- *
- * @param numberOfLimitedStatuses an enumeration of statuses that matched
- * the track predicate but were administratively limited.
- * @see Streaming
- * API Concepts - Filter Limiting | Twitter Developers
- * @see Streaming
- * API Concepts - Parsing Responses | Twitter Developers
- * @see Twitter
- * Development Talk - Track API Limit message meaning
- * @since Twitter4J 2.1.0
- */
- void onTrackLimitationNotice(int numberOfLimitedStatuses);
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusStream.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusStream.java
deleted file mode 100644
index 18065bb06..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusStream.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-import java.io.IOException;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.0.4
- */
-public interface StatusStream {
-
- void close() throws IOException;
-
- /**
- * Reads next status from this stream.
- *
- * @param listener a StatusListener implementation
- * @throws TwitterException when the end of the stream has been reached.
- * @throws IllegalStateException when the end of the stream had been
- * reached.
- */
- void next(StatusListener listener) throws TwitterException;
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusStreamBase.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusStreamBase.java
deleted file mode 100755
index 27bb14f87..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusStreamBase.java
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import twitter4j.conf.StreamConfiguration;
-import twitter4j.http.HttpResponse;
-import twitter4j.internal.async.Dispatcher;
-import twitter4j.internal.json.DataObjectFactoryUtil;
-import twitter4j.internal.json.InternalJSONFactory;
-import twitter4j.internal.json.InternalJSONFactoryImpl;
-import twitter4j.internal.logging.Logger;
-import twitter4j.json.JSONObjectType;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.8
- */
-abstract class StatusStreamBase implements StatusStream {
- protected static final Logger logger = Logger.getLogger(StatusStreamImpl.class);
-
- private boolean streamAlive = true;
- private final BufferedReader br;
- private final InputStream is;
- private HttpResponse response;
- protected final Dispatcher dispatcher;
- protected final StreamConfiguration CONF;
- protected InternalJSONFactory factory;
-
- /* package */
-
- StatusStreamBase(final Dispatcher dispatcher, final HttpResponse response, final StreamConfiguration conf)
- throws IOException {
- this(dispatcher, response.asStream(), conf);
- this.response = response;
- }
-
- StatusStreamBase(final Dispatcher dispatcher, final InputStream stream, final StreamConfiguration conf)
- throws IOException {
- is = stream;
- br = new BufferedReader(new InputStreamReader(stream, "UTF-8"));
- this.dispatcher = dispatcher;
- CONF = conf;
- factory = new InternalJSONFactoryImpl(conf);
- }
-
- /* package */
-
- @Override
- public void close() throws IOException {
- streamAlive = false;
- is.close();
- br.close();
- if (response != null) {
- response.disconnect();
- }
- }
-
- @Override
- public abstract void next(StatusListener listener) throws TwitterException;
-
- public abstract void next(StreamListener[] listeners, RawStreamListener[] rawStreamListeners)
- throws TwitterException;
-
- public void onException(final Exception e, final StreamListener[] listeners,
- final RawStreamListener[] rawStreamListeners) {
- for (final StreamListener listener : listeners) {
- listener.onException(e);
- }
- for (final RawStreamListener listener : rawStreamListeners) {
- listener.onException(e);
- }
- }
-
- protected DirectMessage asDirectMessage(final JSONObject json) throws TwitterException {
- DirectMessage directMessage;
- try {
- directMessage = factory.createDirectMessage(json.getJSONObject("direct_message"));
- } catch (final JSONException e) {
- throw new TwitterException(e);
- }
- if (CONF.isJSONStoreEnabled()) {
- DataObjectFactoryUtil.registerJSONObject(directMessage, json);
- }
- return directMessage;
- }
-
- protected long[] asFriendList(final JSONObject json) throws TwitterException {
- JSONArray friends;
- try {
- friends = json.getJSONArray("friends");
- final long[] friendIds = new long[friends.length()];
- for (int i = 0; i < friendIds.length; ++i) {
- friendIds[i] = Long.parseLong(friends.getString(i));
- }
- return friendIds;
- } catch (final JSONException e) {
- throw new TwitterException(e);
- }
- }
-
- protected Status asStatus(final JSONObject json) throws TwitterException {
- final Status status = factory.createStatus(json);
- if (CONF.isJSONStoreEnabled()) {
- DataObjectFactoryUtil.registerJSONObject(status, json);
- }
- return status;
- }
-
- protected User asUser(final JSONObject json) throws TwitterException {
- final User user = factory.createUser(json);
- if (CONF.isJSONStoreEnabled()) {
- DataObjectFactoryUtil.registerJSONObject(user, json);
- }
- return user;
- }
-
- protected UserList asUserList(final JSONObject json) throws TwitterException {
- final UserList userList = factory.createAUserList(json);
- if (CONF.isJSONStoreEnabled()) {
- DataObjectFactoryUtil.registerJSONObject(userList, json);
- }
- return userList;
- }
-
- protected void handleNextElement(final StreamListener[] listeners, final RawStreamListener[] rawStreamListeners)
- throws TwitterException {
- if (!streamAlive) throw new IllegalStateException("Stream already closed.");
- try {
- final String line = br.readLine();
- if (null == line) // invalidate this status stream
- throw new IOException("the end of the stream has been reached");
- dispatcher.invokeLater(new StreamEvent(line) {
- @Override
- public void run() {
- try {
- if (rawStreamListeners.length > 0) {
- onMessage(line, rawStreamListeners);
- }
- // SiteStreamsImpl will parse "forUser" attribute
- line = parseLine(line);
- if (line != null && line.length() > 0) {
- // parsing JSON is an expensive process and can be
- // avoided when all listeners are instanceof
- // RawStreamListener
- if (listeners.length > 0) {
- if (CONF.isJSONStoreEnabled()) {
- DataObjectFactoryUtil.clearThreadLocalMap();
- }
- final JSONObject json = new JSONObject(line);
- final JSONObjectType.Type event = JSONObjectType.determine(json);
- if (logger.isDebugEnabled()) {
- logger.debug("Received:",
- CONF.isPrettyDebugEnabled() ? json.toString(1) : json.toString());
- }
- switch (event) {
- case SENDER:
- onSender(json, listeners);
- break;
- case STATUS:
- onStatus(json, listeners);
- break;
- case DIRECT_MESSAGE:
- onDirectMessage(json, listeners);
- break;
- case DELETE:
- onDelete(json, listeners);
- break;
- case LIMIT:
- onLimit(json, listeners);
- break;
- case STALL_WARNING:
- onStallWarning(json, listeners);
- break;
- case SCRUB_GEO:
- onScrubGeo(json, listeners);
- break;
- case FRIENDS:
- onFriends(json, listeners);
- break;
- case FAVORITE:
- onFavorite(json.getJSONObject("source"), json.getJSONObject("target"),
- json.getJSONObject("target_object"), listeners);
- break;
- case UNFAVORITE:
- onUnfavorite(json.getJSONObject("source"), json.getJSONObject("target"),
- json.getJSONObject("target_object"), listeners);
- break;
- case FOLLOW:
- onFollow(json.getJSONObject("source"), json.getJSONObject("target"), listeners);
- break;
- case UNFOLLOW:
- onUnfollow(json.getJSONObject("source"), json.getJSONObject("target"),
- listeners);
- break;
- case USER_LIST_MEMBER_ADDED:
- onUserListMemberAddition(json.getJSONObject("target"),
- json.getJSONObject("source"), json.getJSONObject("target_object"),
- listeners);
- break;
- case USER_LIST_MEMBER_DELETED:
- onUserListMemberDeletion(json.getJSONObject("target"),
- json.getJSONObject("source"), json.getJSONObject("target_object"),
- listeners);
- break;
- case USER_LIST_SUBSCRIBED:
- onUserListSubscription(json.getJSONObject("source"),
- json.getJSONObject("target"), json.getJSONObject("target_object"),
- listeners);
- break;
- case USER_LIST_UNSUBSCRIBED:
- onUserListUnsubscription(json.getJSONObject("source"),
- json.getJSONObject("target"), json.getJSONObject("target_object"),
- listeners);
- break;
- case USER_LIST_CREATED:
- onUserListCreation(json.getJSONObject("source"), json.getJSONObject("target"),
- listeners);
- break;
- case USER_LIST_UPDATED:
- onUserListUpdated(json.getJSONObject("source"), json.getJSONObject("target"),
- listeners);
- break;
- case USER_LIST_DESTROYED:
- onUserListDestroyed(json.getJSONObject("source"), json.getJSONObject("target"),
- listeners);
- break;
- case USER_UPDATE:
- onUserUpdate(json.getJSONObject("source"), json.getJSONObject("target"),
- listeners);
- break;
- case BLOCK:
- onBlock(json.getJSONObject("source"), json.getJSONObject("target"), listeners);
- break;
- case UNBLOCK:
- onUnblock(json.getJSONObject("source"), json.getJSONObject("target"), listeners);
- break;
- case DISCONNECTION:
- onDisconnectionNotice(line, listeners);
- break;
- case UNKNOWN:
- default:
- logger.warn("Received unknown event:",
- CONF.isPrettyDebugEnabled() ? json.toString(1) : json.toString());
- }
- }
- }
- } catch (final Exception ex) {
- onException(ex, listeners);
- }
- }
- });
-
- } catch (final IOException ioe) {
- try {
- is.close();
- } catch (final IOException ignore) {
- }
- final boolean isUnexpectedException = streamAlive;
- streamAlive = false;
- if (isUnexpectedException) throw new TwitterException("Stream closed.", ioe);
- }
- }
-
- protected void onBlock(final JSONObject source, final JSONObject target, final StreamListener[] listeners)
- throws TwitterException {
- logger.warn("Unhandled event: onBlock");
- }
-
- protected void onDelete(final JSONObject json, final StreamListener[] listeners) throws TwitterException,
- JSONException {
- logger.warn("Unhandled event: onDelete");
- }
-
- protected void onDirectMessage(final JSONObject json, final StreamListener[] listeners) throws TwitterException,
- JSONException {
- logger.warn("Unhandled event: onDirectMessage");
- }
-
- protected void onDisconnectionNotice(final String line, final StreamListener[] listeners) {
- logger.warn("Unhandled event: ", line);
- }
-
- protected void onException(final Exception e, final StreamListener[] listeners) {
- logger.warn("Unhandled event: ", e.getMessage());
- }
-
- protected void onFavorite(final JSONObject source, final JSONObject target, final JSONObject targetObject,
- final StreamListener[] listeners) throws TwitterException {
- logger.warn("Unhandled event: onFavorite");
- }
-
- protected void onFollow(final JSONObject source, final JSONObject target, final StreamListener[] listeners)
- throws TwitterException {
- logger.warn("Unhandled event: onFollow");
- }
-
- protected void onFriends(final JSONObject json, final StreamListener[] listeners) throws TwitterException,
- JSONException {
- logger.warn("Unhandled event: onFriends");
- }
-
- protected void onLimit(final JSONObject json, final StreamListener[] listeners) throws TwitterException,
- JSONException {
- logger.warn("Unhandled event: onLimit");
- }
-
- protected void onMessage(final String rawString, final RawStreamListener[] listeners) throws TwitterException {
- logger.warn("Unhandled event: onMessage");
- }
-
- protected void onScrubGeo(final JSONObject json, final StreamListener[] listeners) throws TwitterException,
- JSONException {
- logger.warn("Unhandled event: onScrubGeo");
- }
-
- protected void onSender(final JSONObject json, final StreamListener[] listeners) throws TwitterException {
- logger.warn("Unhandled event: onSender");
- }
-
- protected void onStallWarning(final JSONObject json, final StreamListener[] listeners) throws TwitterException,
- JSONException {
- logger.warn("Unhandled event: onStallWarning");
- }
-
- protected void onStatus(final JSONObject json, final StreamListener[] listeners) throws TwitterException {
- logger.warn("Unhandled event: onStatus");
- }
-
- protected void onUnblock(final JSONObject source, final JSONObject target, final StreamListener[] listeners)
- throws TwitterException {
- logger.warn("Unhandled event: onUnblock");
- }
-
- protected void onUnfavorite(final JSONObject source, final JSONObject target, final JSONObject targetObject,
- final StreamListener[] listeners) throws TwitterException {
- logger.warn("Unhandled event: onUnfavorite");
- }
-
- protected void onUnfollow(final JSONObject source, final JSONObject target, final StreamListener[] listeners)
- throws TwitterException {
- logger.warn("Unhandled event: onUnfollow");
- }
-
- protected void onUserListCreation(final JSONObject source, final JSONObject userList,
- final StreamListener[] listeners) throws TwitterException, JSONException {
- logger.warn("Unhandled event: onUserListCreation");
- }
-
- protected void onUserListDestroyed(final JSONObject source, final JSONObject userList,
- final StreamListener[] listeners) throws TwitterException {
- logger.warn("Unhandled event: onUserListDestroyed");
- }
-
- protected void onUserListMemberAddition(final JSONObject addedMember, final JSONObject owner,
- final JSONObject userList, final StreamListener[] listeners) throws TwitterException, JSONException {
- logger.warn("Unhandled event: onUserListMemberAddition");
- }
-
- protected void onUserListMemberDeletion(final JSONObject deletedMember, final JSONObject owner,
- final JSONObject userList, final StreamListener[] listeners) throws TwitterException, JSONException {
- logger.warn("Unhandled event: onUserListMemberDeletion");
- }
-
- protected void onUserListSubscription(final JSONObject source, final JSONObject owner, final JSONObject userList,
- final StreamListener[] listeners) throws TwitterException, JSONException {
- logger.warn("Unhandled event: onUserListSubscription");
- }
-
- protected void onUserListUnsubscription(final JSONObject source, final JSONObject owner, final JSONObject userList,
- final StreamListener[] listeners) throws TwitterException, JSONException {
- logger.warn("Unhandled event: onUserListUnsubscription");
- }
-
- protected void onUserListUpdated(final JSONObject source, final JSONObject userList,
- final StreamListener[] listeners) throws TwitterException, JSONException {
- logger.warn("Unhandled event: onUserListUpdated");
- }
-
- protected void onUserUpdate(final JSONObject source, final JSONObject target, final StreamListener[] listeners)
- throws TwitterException {
- logger.warn("Unhandled event: onUserUpdate");
- }
-
- protected String parseLine(final String line) {
- return line;
- }
-
- abstract class StreamEvent implements Runnable {
- String line;
-
- StreamEvent(final String line) {
- this.line = line;
- }
- }
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusStreamImpl.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusStreamImpl.java
deleted file mode 100644
index ec3da949d..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StatusStreamImpl.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import twitter4j.conf.StreamConfiguration;
-import twitter4j.http.HttpResponse;
-import twitter4j.internal.async.Dispatcher;
-import twitter4j.internal.util.InternalParseUtil;
-
-/**
- * StatusStream implementation. This class is NOT intended to be extended but
- * left non-final for the ease of mock testing.
- *
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.2
- */
-class StatusStreamImpl extends StatusStreamBase {
- /* package */
-
- protected String line;
-
- protected static final RawStreamListener[] EMPTY = new RawStreamListener[0];
-
- StatusStreamImpl(final Dispatcher dispatcher, final HttpResponse response, final StreamConfiguration conf)
- throws IOException {
- super(dispatcher, response, conf);
- }
-
- StatusStreamImpl(final Dispatcher dispatcher, final InputStream stream, final StreamConfiguration conf)
- throws IOException {
- super(dispatcher, stream, conf);
- }
-
- /* package */
- @Override
- public void next(final StatusListener listener) throws TwitterException {
- handleNextElement(new StatusListener[] { listener }, EMPTY);
- }
-
- @Override
- public void next(final StreamListener[] listeners, final RawStreamListener[] rawStreamListeners)
- throws TwitterException {
- handleNextElement(listeners, rawStreamListeners);
- }
-
- @Override
- public void onException(final Exception e, final StreamListener[] listeners) {
- for (final StreamListener listener : listeners) {
- listener.onException(e);
- }
- }
-
- @Override
- protected void onDelete(final JSONObject json, final StreamListener[] listeners) throws TwitterException,
- JSONException {
- for (final StreamListener listener : listeners) {
- final JSONObject deletionNotice = json.getJSONObject("delete");
- if (deletionNotice.has("status")) {
- ((StatusListener) listener).onDeletionNotice(new StatusDeletionNoticeImpl(deletionNotice
- .getJSONObject("status")));
- } else {
- final JSONObject directMessage = deletionNotice.getJSONObject("direct_message");
- ((UserStreamListener) listener).onDeletionNotice(InternalParseUtil.getLong("id", directMessage),
- InternalParseUtil.getLong("user_id", directMessage));
- }
- }
- }
-
- @Override
- protected void onLimit(final JSONObject json, final StreamListener[] listeners) throws TwitterException,
- JSONException {
- for (final StreamListener listener : listeners) {
- ((StatusListener) listener).onTrackLimitationNotice(InternalParseUtil.getInt("track",
- json.getJSONObject("limit")));
- }
- }
-
- @Override
- protected void onMessage(final String rawString, final RawStreamListener[] listeners) throws TwitterException {
- for (final RawStreamListener listener : listeners) {
- listener.onMessage(rawString);
- }
- }
-
- @Override
- protected void onScrubGeo(final JSONObject json, final StreamListener[] listeners) throws TwitterException,
- JSONException {
- final JSONObject scrubGeo = json.getJSONObject("scrub_geo");
- for (final StreamListener listener : listeners) {
- ((StatusListener) listener).onScrubGeo(InternalParseUtil.getLong("user_id", scrubGeo),
- InternalParseUtil.getLong("up_to_status_id", scrubGeo));
- }
-
- }
-
- @Override
- protected void onStallWarning(final JSONObject json, final StreamListener[] listeners) throws TwitterException,
- JSONException {
- for (final StreamListener listener : listeners) {
- ((StatusListener) listener).onStallWarning(new StallWarning(json));
- }
- }
-
- @Override
- protected void onStatus(final JSONObject json, final StreamListener[] listeners) throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((StatusListener) listener).onStatus(asStatus(json));
- }
- }
-
- @Override
- protected String parseLine(final String line) {
- this.line = line;
- return line;
- }
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StreamController.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StreamController.java
deleted file mode 100644
index 110436ab9..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StreamController.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- * Copyright (C) 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package twitter4j;
-
-import static twitter4j.internal.util.InternalParseUtil.getBoolean;
-import static twitter4j.internal.util.InternalParseUtil.getLong;
-import static twitter4j.internal.util.InternalParseUtil.getRawString;
-
-import java.io.Serializable;
-import java.util.Arrays;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import twitter4j.auth.Authorization;
-import twitter4j.auth.AuthorizationFactory;
-import twitter4j.conf.Configuration;
-import twitter4j.http.HttpClientWrapper;
-import twitter4j.http.HttpParameter;
-import twitter4j.http.HttpResponse;
-import twitter4j.internal.util.InternalParseUtil;
-import twitter4j.internal.util.InternalStringUtil;
-
-/**
- * @author Yusuke Yamamoto - yusuke at twitter.com
- * @since Twitter4J 2.2.6
- */
-public class StreamController {
- private String controlURI = null;
- private final HttpClientWrapper HTTP;
- private final Authorization AUTH;
-
- Object lock = new Object();
-
- /* package */StreamController(final Configuration conf) {
- HTTP = new HttpClientWrapper(conf);
- AUTH = AuthorizationFactory.getInstance(conf);
- }
-
- /* package */StreamController(final HttpClientWrapper http, final Authorization auth) {
- HTTP = http;
- AUTH = auth;
- }
-
- public String addUsers(final long[] userIds) throws TwitterException {
- ensureControlURISet();
- final HttpParameter param = new HttpParameter("user_id", InternalStringUtil.join(userIds));
- final HttpResponse res = HTTP.post(controlURI + "/add_user.json", controlURI + "/add_user.json",
- new HttpParameter[] { param }, AUTH);
- return res.asString();
- }
-
- public FriendsIDs getFriendsIDs(final long userId, final long cursor) throws TwitterException {
- ensureControlURISet();
- final HttpResponse res = HTTP
- .post(controlURI + "/friends/ids.json", controlURI + "/friends/ids.json", new HttpParameter[] {
- new HttpParameter("user_id", userId), new HttpParameter("cursor", cursor) }, AUTH);
- return new FriendsIDs(res);
- }
-
- public ControlStreamInfo getInfo() throws TwitterException {
- ensureControlURISet();
- final HttpResponse res = HTTP.get(controlURI + "/info.json", controlURI + "/info.json", AUTH);
- return new ControlStreamInfo(this, res.asJSONObject());
- }
-
- public String removeUsers(final long[] userIds) throws TwitterException {
- ensureControlURISet();
- final HttpParameter param = new HttpParameter("user_id", InternalStringUtil.join(userIds));
- final HttpResponse res = HTTP.post(controlURI + "/remove_user.json", controlURI + "/remove_user.json",
- new HttpParameter[] { param }, AUTH);
- return res.asString();
- }
-
- /* package */User createUser(final JSONObject json) {
- return new User(json);
- }
-
- void ensureControlURISet() throws TwitterException {
- synchronized (lock) {
- try {
- while (controlURI == null) {
- lock.wait(30000);
- throw new TwitterException("timed out for control uri to be ready");
- }
- } catch (final InterruptedException e) {
- }
- }
- }
-
- String getControlURI() {
- return controlURI;
- }
-
- void setControlURI(final String controlURI) {
- this.controlURI = controlURI.replace("/1.1//1.1/", "/1.1/");
- synchronized (lock) {
- lock.notifyAll();
- }
- }
-
- public final class FriendsIDs implements CursorSupport, Serializable {
- private static final long serialVersionUID = -6282978710522199102L;
- private long[] ids;
- private long previousCursor = -1;
- private long nextCursor = -1;
- private User user;
-
- /* package */FriendsIDs(final HttpResponse res) throws TwitterException {
- init(res.asJSONObject());
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- final FriendsIDs that = (FriendsIDs) o;
-
- if (nextCursor != that.nextCursor) return false;
- if (previousCursor != that.previousCursor) return false;
- if (!Arrays.equals(ids, that.ids)) return false;
- if (user != null ? !user.equals(that.user) : that.user != null) return false;
-
- return true;
- }
-
- public long[] getIds() {
- return ids;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public long getNextCursor() {
- return nextCursor;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public long getPreviousCursor() {
- return previousCursor;
- }
-
- public User getUser() {
- return user;
- }
-
- @Override
- public int hashCode() {
- int result = ids != null ? Arrays.hashCode(ids) : 0;
- result = 31 * result + (int) (previousCursor ^ previousCursor >>> 32);
- result = 31 * result + (int) (nextCursor ^ nextCursor >>> 32);
- result = 31 * result + (user != null ? user.hashCode() : 0);
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean hasNext() {
- return 0 != nextCursor;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean hasPrevious() {
- return 0 != previousCursor;
- }
-
- @Override
- public String toString() {
- return "FriendsIDs{" + "ids=" + ids + ", previousCursor=" + previousCursor + ", nextCursor=" + nextCursor
- + ", user=" + user + '}';
- }
-
- private void init(final JSONObject json) throws TwitterException {
- try {
- final JSONObject follow = json.getJSONObject("follow");
- final JSONArray idList = follow.getJSONArray("friends");
- ids = new long[idList.length()];
- for (int i = 0; i < idList.length(); i++) {
- try {
- ids[i] = Long.parseLong(idList.getString(i));
- } catch (final NumberFormatException nfe) {
- throw new TwitterException("Twitter API returned malformed response: " + json, nfe);
- }
- }
- user = new User(follow.getJSONObject("user"));
- previousCursor = InternalParseUtil.getLong("previous_cursor", json);
- nextCursor = InternalParseUtil.getLong("next_cursor", json);
- } catch (final JSONException jsone) {
- throw new TwitterException(jsone);
- }
- }
- }
-
- public final class User implements Serializable {
- private static final long serialVersionUID = -2925833063500478073L;
- private final long id;
- private final String name;
- private final boolean dm;
-
- /* package */User(final JSONObject json) {
- id = getLong("id", json);
- name = getRawString("name", json);
- dm = getBoolean("dm", json);
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- final User user = (User) o;
-
- if (dm != user.dm) return false;
- if (id != user.id) return false;
- if (name != null ? !name.equals(user.name) : user.name != null) return false;
-
- return true;
- }
-
- public long getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
- @Override
- public int hashCode() {
- int result = (int) (id ^ id >>> 32);
- result = 31 * result + (name != null ? name.hashCode() : 0);
- result = 31 * result + (dm ? 1 : 0);
- return result;
- }
-
- public boolean isDMAccessible() {
- return dm;
- }
-
- @Override
- public String toString() {
- return "User{" + "id=" + id + ", name='" + name + '\'' + ", dm=" + dm + '}';
- }
- }
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StreamImplementation.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StreamImplementation.java
deleted file mode 100644
index 85f2d1ad6..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StreamImplementation.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package twitter4j;
-
-import java.io.IOException;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.8
- */
-interface StreamImplementation {
- void close() throws IOException;
-
- void next(StreamListener[] listeners, RawStreamListener[] rawStreamListeners) throws TwitterException;
-
- void onException(Exception ex, StreamListener[] listeners, RawStreamListener[] rawStreamListeners);
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StreamListener.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StreamListener.java
deleted file mode 100644
index 463cf9298..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/StreamListener.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.8
- */
-interface StreamListener {
- void onException(Exception ex);
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/TwitterStream.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/TwitterStream.java
deleted file mode 100755
index d07b61d58..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/TwitterStream.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * Twidere - Twitter client for Android
- *
- * Copyright (C) 2012-2015 Mariotaku Lee
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package twitter4j;
-
-import twitter4j.auth.OAuthSupport;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.2.0
- */
-public interface TwitterStream extends OAuthSupport, TwitterBase {
- /**
- * Adds a ConnectionLifeCycleListener
- *
- * @param listener listener to be added
- * @since Twitter4J 2.1.7
- */
- void addConnectionLifeCycleListener(ConnectionLifeCycleListener listener);
-
- /**
- * @param listener listener to add
- * @since Twitter4J 3.0.2
- */
- void addListener(RawStreamListener listener);
-
- /**
- * @param listener listener to add
- * @since Twitter4J 2.1.8
- */
- void addListener(SiteStreamsListener listener);
-
- /**
- * @param listener listener to add
- * @since Twitter4J 2.1.8
- */
- void addListener(StatusListener listener);
-
- /**
- * @param listener listener to add
- * @since Twitter4J 2.1.8
- */
- void addListener(UserStreamListener listener);
-
- /**
- * shutdown internal stream consuming thread
- *
- * @since Twitter4J 2.1.7
- */
- void cleanUp();
-
- /**
- * Start consuming public statuses that match one or more filter predicates.
- * At least one predicate parameter, follow, locations, or track must be
- * specified. Multiple parameters may be specified which allows most clients
- * to use a single connection to the Streaming API. Placing long parameters
- * in the URL may cause the request to be rejected for excessive URL length.
- * The default access level allows up to 200 track keywords, 400 follow
- * userids and 10 1-degree location boxes. Increased access levels allow
- * 80,000 follow userids ("shadow" role), 400,000 follow userids ("birddog"
- * role), 10,000 track keywords ("restricted track" role), 200,000 track
- * keywords ("partner track" role), and 200 10-degree location boxes
- * ("locRestricted" role). Increased track access levels also pass a higher
- * proportion of statuses before limiting the stream.
- *
- * @param query Filter query
- * @see StatusStream
- * @see Streaming
- * API Methods statuses/filter
- * @since Twitter4J 2.1.2
- */
- void filter(final FilterQuery query);
-
- /**
- * Starts listening on all public statuses. Available only to approved
- * parties and requires a signed agreement to access. Please do not contact
- * us about access to the firehose. If your service warrants access to it,
- * we'll contact you.
- *
- * @param count Indicates the number of previous statuses to stream before
- * transitioning to the live stream.
- * @see StatusStream
- * @see Streaming
- * API Methods statuses/firehose
- * @since Twitter4J 2.0.4
- */
- void firehose(final int count);
-
- /**
- * Returns public statuses that match one or more filter predicates. At
- * least one predicate parameter, follow, locations, or track must be
- * specified. Multiple parameters may be specified which allows most clients
- * to use a single connection to the Streaming API. Placing long parameters
- * in the URL may cause the request to be rejected for excessive URL length.
- * The default access level allows up to 200 track keywords, 400 follow
- * userids and 10 1-degree location boxes. Increased access levels allow
- * 80,000 follow userids ("shadow" role), 400,000 follow userids ("birddog"
- * role), 10,000 track keywords ("restricted track" role), 200,000 track
- * keywords ("partner track" role), and 200 10-degree location boxes
- * ("locRestricted" role). Increased track access levels also pass a higher
- * proportion of statuses before limiting the stream.
- *
- * @param query Filter query
- * @return StatusStream
- * @throws TwitterException when Twitter service or network is unavailable
- * @see StatusStream
- * @see Streaming
- * API Methods | Twitter Developers
- * @since Twitter4J 2.1.2
- * @deprecated use {@link #filter(twitter4j.FilterQuery)} instead
- */
- @Deprecated
- StatusStream getFilterStream(FilterQuery query) throws TwitterException;
-
- /**
- * Returns a status stream of all public statuses. Available only to
- * approved parties and requires a signed agreement to access. Please do not
- * contact us about access to the firehose. If your service warrants access
- * to it, we'll contact you.
- *
- * @param count Indicates the number of previous statuses to stream before
- * transitioning to the live stream.
- * @return StatusStream
- * @throws TwitterException when Twitter service or network is unavailable
- * @see StatusStream
- * @see Streaming
- * API Methods statuses/firehose
- * @since Twitter4J 2.0.4
- * @deprecated use {@link #firehose(int)} instead
- */
- @Deprecated
- StatusStream getFirehoseStream(int count) throws TwitterException;
-
- /**
- * Returns a status stream of all public statuses containing links.
- * Available only to approved parties and requires a signed agreement to
- * access. Please do not contact us about access to the links stream. If
- * your service warrants access to it, we'll contact you.
- *
- * @param count Indicates the number of previous statuses to stream before
- * transitioning to the live stream.
- * @return StatusStream
- * @throws TwitterException when Twitter service or network is unavailable
- * @see StatusStream
- * @see Streaming
- * API Methods statuses/links
- * @since Twitter4J 2.1.1
- * @deprecated use {@link #links(int)} instead
- */
- @Deprecated
- StatusStream getLinksStream(int count) throws TwitterException;
-
- /**
- * Returns a stream of all retweets. The retweet stream is not a generally
- * available resource. Few applications require this level of access.
- * Creative use of a combination of other resources and various access
- * levels can satisfy nearly every application use case. As of 9/11/2009,
- * the site-wide retweet feature has not yet launched, so there are
- * currently few, if any, retweets on this stream.
- *
- * @return StatusStream
- * @throws TwitterException when Twitter service or network is unavailable
- * @see StatusStream
- * @see Streaming
- * API: Methods statuses/retweet
- * @since Twitter4J 2.0.10
- * @deprecated use {@link #getRetweetStream()} instead
- */
- @Deprecated
- StatusStream getRetweetStream() throws TwitterException;
-
- /**
- * Returns a stream of random sample of all public statuses. The default
- * access level provides a small proportion of the Firehose. The
- * "Gardenhose" access level provides a proportion more suitable for data
- * mining and research applications that desire a larger proportion to be
- * statistically significant sample.
- *
- * @return StatusStream
- * @throws TwitterException when Twitter service or network is unavailable
- * @see StatusStream
- * @see Streaming
- * API: Methods statuses/sample
- * @since Twitter4J 2.0.10
- * @deprecated use {@link #sample()} instead
- */
- @Deprecated
- StatusStream getSampleStream() throws TwitterException;
-
- /**
- * User Streams provides real-time updates of all data needed to update a
- * desktop application display. Applications can request startup back-fill
- * from the REST API and then transition to Streaming for nearly all
- * subsequent reads. Rate limits and latency are practically eliminated.
- * Desktop developers can stop managing rate limits and use this new data to
- * create an entirely new user experience. On our end, we hope to reduce
- * costs and increase site reliability.
- *
- * @return UserStream
- * @throws TwitterException when Twitter service or network is unavailable
- * @see User
- * Streams
- * @deprecated use {@link #user()} instead
- */
- @Deprecated
- UserStream getUserStream() throws TwitterException;
-
- /**
- * User Streams provides real-time updates of all data needed to update a
- * desktop application display. Applications can request startup back-fill
- * from the REST API and then transition to Streaming for nearly all
- * subsequent reads. Rate limits and latency are practically eliminated.
- * Desktop developers can stop managing rate limits and use this new data to
- * create an entirely new user experience. On our end, we hope to reduce
- * costs and increase site reliability.
- *
- * @param track keywords to track
- * @return UserStream
- * @throws TwitterException when Twitter service or network is unavailable
- * @see User
- * Streams
- * @since Twitter4J 2.1.9
- * @deprecated use {@link #user()} instead
- */
- @Deprecated
- UserStream getUserStream(String[] track) throws TwitterException;
-
- /**
- * Starts listening on all public statuses containing links. Available only
- * to approved parties and requires a signed agreement to access. Please do
- * not contact us about access to the links stream. If your service warrants
- * access to it, we'll contact you.
- *
- * @param count Indicates the number of previous statuses to stream before
- * transitioning to the live stream.
- * @see StatusStream
- * @see Streaming
- * API Methods statuses/links
- * @since Twitter4J 2.1.1
- */
- void links(final int count);
-
- /**
- * Starts listening on all retweets. The retweet stream is not a generally
- * available resource. Few applications require this level of access.
- * Creative use of a combination of other resources and various access
- * levels can satisfy nearly every application use case. As of 9/11/2009,
- * the site-wide retweet feature has not yet launched, so there are
- * currently few, if any, retweets on this stream.
- *
- * @see StatusStream
- * @see Streaming
- * API Methods statuses/retweet
- * @since Twitter4J 2.0.10
- */
- void retweet();
-
- /**
- * Starts listening on random sample of all public statuses. The default
- * access level provides a small proportion of the Firehose. The
- * "Gardenhose" access level provides a proportion more suitable for data
- * mining and research applications that desire a larger proportion to be
- * statistically significant sample.
- *
- * @see StatusStream
- * @see Streaming
- * API: Methods statuses/sample
- * @since Twitter4J 2.0.10
- */
- void sample();
-
- /**
- * Shuts down internal dispatcher thread shared by all TwitterStream
- * instances.
- *
- * @since Twitter4J 2.1.9
- */
- @Override
- void shutdown();
-
- /**
- * Site Streams, a new feature on the Streaming API, is now available for
- * beta testing. Site Streams allows services, such as web sites or mobile
- * push services, to receive real-time updates for a large number of users
- * without any of the hassles of managing REST API rate limits. The initial
- * version delivers events created by, or directed to, users that have
- * shared their OAuth token with your application. The following events are
- * streamed immediately, and without rate limits: Home Timelines, Mentions
- * Timelines, User Timelines, Direct Messages, Mentions, Follows, Favorites,
- * Tweets, Retweets, Profile changes, and List changes. The following
- * limitations must be respected during the beta period. These limitations
- * may be changed with little advance notice. We intend to increase or
- * remove these various limitations as we move from beta test into full
- * production:
- * Limit the follow count to 100 users per stream. Clients must occasionally
- * compact users onto a smaller number of connections to minimize the total
- * number of connections outstanding.
- * Open no more than 25 new connections per second and exponentially
- * back-off on errors.
- *
- * @param withFollowings whether to receive status updates from people
- * following
- * @param follow an array of users to include in the stream
- * @see Site
- * Streams | Twitter Developers
- * @since Twitter4J 2.1.8
- */
- StreamController site(final boolean withFollowings, final long[] follow);
-
- /**
- * User Streams provides real-time updates of all data needed to update a
- * desktop application display. Applications can request startup back-fill
- * from the REST API and then transition to Streaming for nearly all
- * subsequent reads. Rate limits and latency are practically eliminated.
- * Desktop developers can stop managing rate limits and use this new data to
- * create an entirely new user experience. On our end, we hope to reduce
- * costs and increase site reliability.
- *
- * @throws IllegalStateException when non-UserStreamListener is set, or no
- * listener is set
- * @see User
- * Streams
- */
- void user();
-
- /**
- * User Streams provides real-time updates of all data needed to update a
- * desktop application display. Applications can request startup back-fill
- * from the REST API and then transition to Streaming for nearly all
- * subsequent reads. Rate limits and latency are practically eliminated.
- * Desktop developers can stop managing rate limits and use this new data to
- * create an entirely new user experience. On our end, we hope to reduce
- * costs and increase site reliability.
- *
- * @param track keywords to track
- * @throws IllegalStateException when non-UserStreamListener is set, or no
- * listener is set
- * @see User
- * Streams
- * @since Twitter4J 2.1.9
- */
- void user(final String[] track);
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/TwitterStreamConstants.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/TwitterStreamConstants.java
deleted file mode 100644
index bfb59bfac..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/TwitterStreamConstants.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package twitter4j;
-
-public interface TwitterStreamConstants extends TwitterConstants {
- public static final String DEFAULT_STREAM_BASE_URL = "https://stream.twitter.com/1.1/";
- public static final String DEFAULT_USER_STREAM_BASE_URL = "https://userstream.twitter.com/1.1/";
- public static final String DEFAULT_SITE_STREAM_BASE_URL = "https://sitestream.twitter.com/1.1/";
-}
\ No newline at end of file
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/TwitterStreamFactory.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/TwitterStreamFactory.java
deleted file mode 100644
index 783ee827e..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/TwitterStreamFactory.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Twidere - Twitter client for Android
- *
- * Copyright (C) 2012-2015 Mariotaku Lee
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package twitter4j;
-
-import twitter4j.auth.AccessToken;
-import twitter4j.auth.Authorization;
-import twitter4j.auth.AuthorizationFactory;
-import twitter4j.auth.OAuthAuthorization;
-import twitter4j.conf.StreamConfiguration;
-import twitter4j.conf.StreamConfigurationContext;
-
-/**
- * A factory class for TwitterFactory.
- * An instance of this class is completely thread safe and can be re-used and
- * used concurrently.
- * Note that TwitterStream is NOT compatible with Google App Engine as GAE is
- * not capable of handling requests longer than 30 seconds.
- *
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.0
- */
-public final class TwitterStreamFactory implements java.io.Serializable {
- private static final long serialVersionUID = 8146074704915782233L;
- private final StreamConfiguration conf;
- private static final TwitterStream SINGLETON;
-
- static {
- SINGLETON = new TwitterStreamImpl(StreamConfigurationContext.getInstance(),
- TwitterFactory.DEFAULT_AUTHORIZATION);
- }
-
- /**
- * Creates a TwitterStreamFactory with the root configuration.
- */
- public TwitterStreamFactory() {
- this(StreamConfigurationContext.getInstance());
- }
-
- /**
- * Creates a TwitterStreamFactory with the given configuration.
- *
- * @param conf the configuration to use
- * @since Twitter4J 2.1.1
- */
- public TwitterStreamFactory(final StreamConfiguration conf) {
- this.conf = conf;
- }
-
- // implementations for BasicSupportFactory
-
- /**
- * Returns a instance associated with the configuration bound to this
- * factory.
- *
- * @return default instance
- */
- public TwitterStream getInstance() {
- return getInstance(AuthorizationFactory.getInstance(conf));
- }
-
- /**
- * Returns a OAuth Authenticated instance.
- * consumer key and consumer Secret must be provided by
- * twitter4j.properties, or system properties. Unlike
- * {@link twitter4j.TwitterStream#setOAuthAccessToken(twitter4j.auth.AccessToken)},
- * this factory method potentially returns a cached instance.
- *
- * @param accessToken access token
- * @return an instance
- */
- public TwitterStream getInstance(final AccessToken accessToken) {
- final String consumerKey = conf.getOAuthConsumerKey();
- final String consumerSecret = conf.getOAuthConsumerSecret();
- if (null == consumerKey && null == consumerSecret)
- throw new IllegalStateException("Consumer key and Consumer secret not supplied.");
- final OAuthAuthorization oauth = new OAuthAuthorization(conf);
- oauth.setOAuthAccessToken(accessToken);
- return getInstance(conf, oauth);
- }
-
- /**
- * Returns a instance.
- *
- * @return an instance
- */
- public TwitterStream getInstance(final Authorization auth) {
- return getInstance(conf, auth);
- }
-
- private TwitterStream getInstance(final StreamConfiguration conf, final Authorization auth) {
- return new TwitterStreamImpl(conf, auth);
- }
-
- /**
- * Returns default singleton TwitterStream instance.
- *
- * @return default singleton TwitterStream instance
- * @since Twitter4J 2.2.4
- */
- public static TwitterStream getSingleton() {
- return SINGLETON;
- }
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/TwitterStreamImpl.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/TwitterStreamImpl.java
deleted file mode 100755
index d38d37380..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/TwitterStreamImpl.java
+++ /dev/null
@@ -1,671 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package twitter4j;
-
-import static twitter4j.http.HttpResponseCode.FORBIDDEN;
-import static twitter4j.http.HttpResponseCode.NOT_ACCEPTABLE;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import twitter4j.auth.Authorization;
-import twitter4j.conf.StreamConfiguration;
-import twitter4j.http.HttpParameter;
-import twitter4j.internal.async.Dispatcher;
-import twitter4j.internal.async.DispatcherFactory;
-import twitter4j.internal.logging.Logger;
-import twitter4j.internal.util.InternalStringUtil;
-
-/**
- * A java representation of the Streaming API:
- * Methods
- * Note that this class is NOT compatible with Google App Engine as GAE is not
- * capable of handling requests longer than 30 seconds.
- *
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.0.4
- */
-class TwitterStreamImpl extends TwitterBaseImpl implements TwitterStream {
- private final StreamConfiguration conf;
- private static final Logger logger = Logger.getLogger(TwitterStreamImpl.class);
-
- private final List lifeCycleListeners = new ArrayList(0);
- private TwitterStreamConsumer handler = null;
-
- private final HttpParameter STALL_WARNINGS;
-
- private static transient Dispatcher dispatcher;
-
- /* Streaming API */
-
- private static int numberOfHandlers = 0;
-
- private final List userStreamListeners = new ArrayList(0);
-
- private final List statusListeners = new ArrayList(0);
-
- private final List siteStreamsListeners = new ArrayList(0);
-
- private final List rawStreamListeners = new ArrayList(0);
-
- /*
- * https://dev.twitter.com/docs/streaming-api/concepts#connecting When a
- * network error (TCP/IP level) is encountered, back off linearly. Perhaps
- * start at 250 milliseconds, double, and cap at 16 seconds When a HTTP
- * error (> 200) is returned, back off exponentially. Perhaps start with a
- * 10 second wait, double on each subsequent failure, and finally cap the
- * wait at 240 seconds. Consider sending an alert to a human operator after
- * multiple HTTP errors, as there is probably a client configuration issue
- * that is unlikely to be resolved without human intervention. There's not
- * much point in polling any faster in the face of HTTP error codes and your
- * client is may run afoul of a rate limit.
- */
- private static final int TCP_ERROR_INITIAL_WAIT = 250;
-
- private static final int TCP_ERROR_WAIT_CAP = 16 * 1000;
-
- private static final int HTTP_ERROR_INITIAL_WAIT = 10 * 1000;
-
- private static final int HTTP_ERROR_WAIT_CAP = 240 * 1000;
-
- private static final int NO_WAIT = 0;
-
- static int count = 0;
-
- /* package */
- TwitterStreamImpl(final StreamConfiguration conf, final Authorization auth) {
- super(conf, auth);
- this.conf = conf;
- STALL_WARNINGS = new HttpParameter("stall_warnings", conf.isStallWarningsEnabled());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void addConnectionLifeCycleListener(final ConnectionLifeCycleListener listener) {
- lifeCycleListeners.add(listener);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void addListener(final RawStreamListener listener) {
- rawStreamListeners.add(listener);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void addListener(final SiteStreamsListener listener) {
- siteStreamsListeners.add(listener);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void addListener(final StatusListener listener) {
- statusListeners.add(listener);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void addListener(final UserStreamListener listener) {
- statusListeners.add(listener);
- userStreamListeners.add(listener);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public synchronized void cleanUp() {
- if (handler != null) {
- handler.close();
- numberOfHandlers--;
- }
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- if (!super.equals(o)) return false;
-
- final TwitterStreamImpl that = (TwitterStreamImpl) o;
-
- if (handler != null ? !handler.equals(that.handler) : that.handler != null) return false;
- if (http != null ? !http.equals(that.http) : that.http != null) return false;
- if (lifeCycleListeners != null ? !lifeCycleListeners.equals(that.lifeCycleListeners)
- : that.lifeCycleListeners != null) return false;
- if (rawStreamListeners != null ? !rawStreamListeners.equals(that.rawStreamListeners)
- : that.rawStreamListeners != null) return false;
- if (siteStreamsListeners != null ? !siteStreamsListeners.equals(that.siteStreamsListeners)
- : that.siteStreamsListeners != null) return false;
- if (STALL_WARNINGS != null ? !STALL_WARNINGS.equals(that.STALL_WARNINGS) : that.STALL_WARNINGS != null)
- return false;
- if (statusListeners != null ? !statusListeners.equals(that.statusListeners) : that.statusListeners != null)
- return false;
- if (userStreamListeners != null ? !userStreamListeners.equals(that.userStreamListeners)
- : that.userStreamListeners != null) return false;
-
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void filter(final FilterQuery query) {
- ensureAuthorizationEnabled();
- ensureStatusStreamListenerIsSet();
- startHandler(new TwitterStreamConsumer(statusListeners, rawStreamListeners) {
- @Override
- public StatusStream getStream() throws TwitterException {
- return getFilterStream(query);
- }
- });
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void firehose(final int count) {
- ensureAuthorizationEnabled();
- ensureStatusStreamListenerIsSet();
- startHandler(new TwitterStreamConsumer(statusListeners, rawStreamListeners) {
- @Override
- public StatusStream getStream() throws TwitterException {
- return getFirehoseStream(count);
- }
- });
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public StatusStream getFilterStream(final FilterQuery query) throws TwitterException {
- ensureAuthorizationEnabled();
- try {
- return new StatusStreamImpl(getDispatcher(),
- http.post(conf.getStreamBaseURL() + "statuses/filter.json", conf.getStreamBaseURL()
- + "statuses/filter.json", query.asHttpParameterArray(STALL_WARNINGS), auth), conf);
- } catch (final IOException e) {
- throw new TwitterException(e);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public StatusStream getFirehoseStream(final int count) throws TwitterException {
- ensureAuthorizationEnabled();
- return getCountStream("statuses/firehose.json", count);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public StatusStream getLinksStream(final int count) throws TwitterException {
- ensureAuthorizationEnabled();
- return getCountStream("statuses/links.json", count);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public StatusStream getRetweetStream() throws TwitterException {
- ensureAuthorizationEnabled();
- try {
- return new StatusStreamImpl(getDispatcher(), http.post(conf.getStreamBaseURL() + "statuses/retweet.json",
- conf.getStreamBaseURL() + "statuses/retweet.json", new HttpParameter[] { STALL_WARNINGS }, auth),
- conf);
- } catch (final IOException e) {
- throw new TwitterException(e);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public StatusStream getSampleStream() throws TwitterException {
- ensureAuthorizationEnabled();
- try {
- return new StatusStreamImpl(getDispatcher(), get(conf.getStreamBaseURL() + "statuses/sample.json",
- conf.getStreamBaseURL() + "statuses/sample.json", STALL_WARNINGS), conf);
- } catch (final IOException e) {
- throw new TwitterException(e);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public UserStream getUserStream() throws TwitterException {
- return getUserStream(null);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public UserStream getUserStream(final String[] track) throws TwitterException {
- ensureAuthorizationEnabled();
- try {
- final List params = new ArrayList();
- params.add(STALL_WARNINGS);
- if (conf.isUserStreamRepliesAllEnabled()) {
- params.add(new HttpParameter("replies", "all"));
- }
- if (track != null) {
- params.add(new HttpParameter("track", InternalStringUtil.join(track)));
- }
- return new UserStreamImpl(getDispatcher(), http.post(conf.getUserStreamBaseURL() + "user.json",
- conf.getUserStreamBaseURL() + "user.json", params.toArray(new HttpParameter[params.size()]), auth),
- conf);
- } catch (final IOException e) {
- throw new TwitterException(e);
- }
- }
-
- @Override
- public int hashCode() {
- int result = super.hashCode();
- result = 31 * result + (http != null ? http.hashCode() : 0);
- result = 31 * result + (lifeCycleListeners != null ? lifeCycleListeners.hashCode() : 0);
- result = 31 * result + (handler != null ? handler.hashCode() : 0);
- result = 31 * result + (STALL_WARNINGS != null ? STALL_WARNINGS.hashCode() : 0);
- result = 31 * result + (userStreamListeners != null ? userStreamListeners.hashCode() : 0);
- result = 31 * result + (statusListeners != null ? statusListeners.hashCode() : 0);
- result = 31 * result + (siteStreamsListeners != null ? siteStreamsListeners.hashCode() : 0);
- result = 31 * result + (rawStreamListeners != null ? rawStreamListeners.hashCode() : 0);
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void links(final int count) {
- ensureAuthorizationEnabled();
- ensureStatusStreamListenerIsSet();
- startHandler(new TwitterStreamConsumer(statusListeners, rawStreamListeners) {
- @Override
- public StatusStream getStream() throws TwitterException {
- return getLinksStream(count);
- }
- });
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void retweet() {
- ensureAuthorizationEnabled();
- ensureStatusStreamListenerIsSet();
- startHandler(new TwitterStreamConsumer(statusListeners, rawStreamListeners) {
- @Override
- public StatusStream getStream() throws TwitterException {
- return getRetweetStream();
- }
- });
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void sample() {
- ensureAuthorizationEnabled();
- ensureStatusStreamListenerIsSet();
- startHandler(new TwitterStreamConsumer(statusListeners, rawStreamListeners) {
- @Override
- public StatusStream getStream() throws TwitterException {
- return getSampleStream();
- }
- });
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public synchronized void shutdown() {
- super.shutdown();
- cleanUp();
- synchronized (TwitterStreamImpl.class) {
- if (0 == numberOfHandlers) {
- if (dispatcher != null) {
- dispatcher.shutdown();
- dispatcher = null;
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public StreamController site(final boolean withFollowings, final long[] follow) {
- ensureOAuthEnabled();
- ensureSiteStreamsListenerIsSet();
- final StreamController cs = new StreamController(http, auth);
- startHandler(new TwitterStreamConsumer(siteStreamsListeners, rawStreamListeners) {
- @Override
- public StatusStream getStream() throws TwitterException {
- try {
- return new SiteStreamsImpl(getDispatcher(), getSiteStream(withFollowings, follow), conf, cs);
- } catch (final IOException e) {
- throw new TwitterException(e);
- }
- }
- });
- return cs;
- }
-
- @Override
- public String toString() {
- return "TwitterStreamImpl{http=" + http + ", conf=" + conf + ", lifeCycleListeners=" + lifeCycleListeners
- + ", handler=" + handler + ", STALL_WARNINGS=" + STALL_WARNINGS + ", userStreamListeners="
- + userStreamListeners + ", statusListeners=" + statusListeners + ", siteStreamsListeners="
- + siteStreamsListeners + ", rawStreamListeners=" + rawStreamListeners + "}";
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void user() {
- user(null);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void user(final String[] track) {
- ensureAuthorizationEnabled();
- ensureUserStreamListenerIsSet();
- startHandler(new TwitterStreamConsumer(statusListeners, rawStreamListeners) {
- @Override
- public StatusStream getStream() throws TwitterException {
- return getUserStream(track);
- }
- });
- }
-
- private void ensureSiteStreamsListenerIsSet() {
- if (siteStreamsListeners.size() == 0 && rawStreamListeners.size() == 0)
- throw new IllegalStateException("SiteStreamsListener is not set.");
- }
-
- /**
- * check if any listener is set. Throws IllegalStateException if no listener
- * is set.
- *
- * @throws IllegalStateException when no listener is set.
- */
-
- private void ensureStatusStreamListenerIsSet() {
- if (statusListeners.size() == 0 && rawStreamListeners.size() == 0)
- throw new IllegalStateException("StatusListener is not set.");
- }
-
- private void ensureUserStreamListenerIsSet() {
- if (userStreamListeners.size() == 0 && rawStreamListeners.size() == 0)
- throw new IllegalStateException("UserStreamListener is not set.");
- }
-
- private StatusStream getCountStream(final String relativeUrl, final int count) throws TwitterException {
- ensureAuthorizationEnabled();
- try {
- return new StatusStreamImpl(getDispatcher(), http.post(conf.getStreamBaseURL() + relativeUrl,
- conf.getStreamBaseURL() + relativeUrl,
- new HttpParameter[] { new HttpParameter("count", String.valueOf(count)), STALL_WARNINGS }, auth),
- conf);
- } catch (final IOException e) {
- throw new TwitterException(e);
- }
- }
-
- private Dispatcher getDispatcher() {
- if (null == TwitterStreamImpl.dispatcher) {
- synchronized (TwitterStreamImpl.class) {
- if (null == TwitterStreamImpl.dispatcher) {
- // dispatcher is held statically, but it'll be instantiated
- // with
- // the configuration instance associated with this
- // TwitterStream
- // instance which invokes getDispatcher() on the first time.
- TwitterStreamImpl.dispatcher = new DispatcherFactory(conf).getInstance();
- }
- }
- }
- return TwitterStreamImpl.dispatcher;
- }
-
- private synchronized void startHandler(final TwitterStreamConsumer handler) {
- cleanUp();
- this.handler = handler;
- this.handler.start();
- numberOfHandlers++;
- }
-
- InputStream getSiteStream(final boolean withFollowings, final long[] follow) throws TwitterException {
- ensureOAuthEnabled();
- return http.post(
- conf.getSiteStreamBaseURL() + "site.json",
- conf.getSiteStreamBaseURL() + "site.json",
- new HttpParameter[] { new HttpParameter("with", withFollowings ? "followings" : "user"),
- new HttpParameter("follow", InternalStringUtil.join(follow)), STALL_WARNINGS }, auth)
- .asStream();
- }
-
- abstract class TwitterStreamConsumer extends Thread {
- private StatusStreamBase stream = null;
- private final String NAME = "Twitter Stream consumer-" + ++count;
- private volatile boolean closed = false;
- private final StreamListener[] streamListeners;
- private final RawStreamListener[] rawStreamListeners;
-
- TwitterStreamConsumer(final List streamListeners,
- final List rawStreamListeners) {
- super();
- setName(NAME + "[initializing]");
- this.streamListeners = streamListeners.toArray(new StreamListener[streamListeners.size()]);
- this.rawStreamListeners = rawStreamListeners.toArray(new RawStreamListener[rawStreamListeners.size()]);
- }
-
- public synchronized void close() {
- setStatus("[Disposing thread]");
- try {
- if (stream != null) {
- try {
- stream.close();
- } catch (final IOException ignore) {
- } catch (final Exception e) {
- e.printStackTrace();
- logger.warn(e.getMessage());
- }
- }
- } finally {
- closed = true;
- }
- }
-
- @Override
- public void run() {
- int timeToSleep = NO_WAIT;
- boolean connected = false;
- while (!closed) {
- try {
- if (!closed && null == stream) {
- // try establishing connection
- logger.info("Establishing connection.");
- setStatus("[Establishing connection]");
- stream = (StatusStreamBase) getStream();
- connected = true;
- logger.info("Connection established.");
- for (final ConnectionLifeCycleListener listener : lifeCycleListeners) {
- try {
- listener.onConnect();
- } catch (final Exception e) {
- logger.warn(e.getMessage());
- }
- }
- // connection established successfully
- timeToSleep = NO_WAIT;
- logger.info("Receiving status stream.");
- setStatus("[Receiving stream]");
- while (!closed) {
- try {
- stream.next(streamListeners, rawStreamListeners);
- } catch (final IllegalStateException ise) {
- logger.warn(ise.getMessage());
- break;
- } catch (final TwitterException e) {
- logger.info(e.getMessage());
- stream.onException(e, streamListeners, rawStreamListeners);
- throw e;
- } catch (final Exception e) {
- logger.info(e.getMessage());
- stream.onException(e, streamListeners, rawStreamListeners);
- closed = true;
- break;
- }
- }
- }
- } catch (final TwitterException te) {
- logger.info(te.getMessage());
- if (!closed) {
- if (NO_WAIT == timeToSleep) {
- if (te.getStatusCode() == FORBIDDEN) {
- logger.warn("This account is not in required role. ", te.getMessage());
- closed = true;
- for (final StreamListener statusListener : streamListeners) {
- statusListener.onException(te);
- }
- break;
- }
- if (te.getStatusCode() == NOT_ACCEPTABLE) {
- logger.warn("Parameter not accepted with the role. ", te.getMessage());
- closed = true;
- for (final StreamListener statusListener : streamListeners) {
- statusListener.onException(te);
- }
- break;
- }
- connected = false;
- for (final ConnectionLifeCycleListener listener : lifeCycleListeners) {
- try {
- listener.onDisconnect();
- } catch (final Exception e) {
- logger.warn(e.getMessage());
- }
- }
- if (te.getStatusCode() > 200) {
- timeToSleep = HTTP_ERROR_INITIAL_WAIT;
- } else if (0 == timeToSleep) {
- timeToSleep = TCP_ERROR_INITIAL_WAIT;
- }
- }
- if (te.getStatusCode() > 200 && timeToSleep < HTTP_ERROR_INITIAL_WAIT) {
- timeToSleep = HTTP_ERROR_INITIAL_WAIT;
- }
- if (connected) {
- for (final ConnectionLifeCycleListener listener : lifeCycleListeners) {
- try {
- listener.onDisconnect();
- } catch (final Exception e) {
- logger.warn(e.getMessage());
- }
- }
- }
- for (final StreamListener statusListener : streamListeners) {
- statusListener.onException(te);
- }
- // there was a problem establishing the connection, or
- // the connection closed by peer
- if (!closed) {
- // wait for a moment not to overload Twitter API
- logger.info("Waiting for " + timeToSleep + " milliseconds");
- setStatus("[Waiting for " + timeToSleep + " milliseconds]");
- try {
- Thread.sleep(timeToSleep);
- } catch (final InterruptedException ignore) {
- }
- timeToSleep = Math.min(timeToSleep * 2, te.getStatusCode() > 200 ? HTTP_ERROR_WAIT_CAP
- : TCP_ERROR_WAIT_CAP);
- }
- stream = null;
- logger.debug(te.getMessage());
- connected = false;
- }
- }
- }
- if (stream != null && connected) {
- try {
- stream.close();
- } catch (final IOException ignore) {
- } catch (final Exception e) {
- e.printStackTrace();
- logger.warn(e.getMessage());
- } finally {
- for (final ConnectionLifeCycleListener listener : lifeCycleListeners) {
- try {
- listener.onDisconnect();
- } catch (final Exception e) {
- logger.warn(e.getMessage());
- }
- }
- }
- }
- for (final ConnectionLifeCycleListener listener : lifeCycleListeners) {
- try {
- listener.onCleanUp();
- } catch (final Exception e) {
- logger.warn(e.getMessage());
- }
- }
- }
-
- private void setStatus(final String message) {
- final String actualMessage = NAME + message;
- setName(actualMessage);
- logger.debug(actualMessage);
- }
-
- abstract StatusStream getStream() throws TwitterException;
-
- }
-}
\ No newline at end of file
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/UserStream.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/UserStream.java
deleted file mode 100644
index 1ab09c20f..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/UserStream.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-import java.io.IOException;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.3
- */
-public interface UserStream extends StatusStream {
- @Override
- void close() throws IOException;
-
- /**
- * Reads next element from this stream.
- *
- * @param listener a UserStreamListener implementation
- * @throws TwitterException when the end of the stream has been reached.
- * @throws IllegalStateException when the end of the stream had been
- * reached.
- */
- void next(UserStreamListener listener) throws TwitterException;
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/UserStreamAdapter.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/UserStreamAdapter.java
deleted file mode 100644
index 8cf32fc46..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/UserStreamAdapter.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-/**
- * @author yusuke at mac.com
- * @since Twitter4J 2.1.3
- */
-public class UserStreamAdapter extends StatusAdapter implements UserStreamListener {
- @Override
- public void onBlock(final User source, final User blockedUser) {
- }
-
- @Override
- public void onDeletionNotice(final long directMessageId, final long userId) {
- }
-
- @Override
- public void onDirectMessage(final DirectMessage directMessage) {
- }
-
- @Override
- public void onException(final Exception ex) {
- }
-
- @Override
- public void onFavorite(final User source, final User target, final Status favoritedStatus) {
- }
-
- @Override
- public void onFollow(final User source, final User followedUser) {
- }
-
- @Override
- public void onFriendList(final long[] friendIds) {
- }
-
- @Override
- public void onUnblock(final User source, final User unblockedUser) {
- }
-
- @Override
- public void onUnfavorite(final User source, final User target, final Status unfavoritedStatus) {
- }
-
- @Override
- public void onUserListCreation(final User listOwner, final UserList list) {
- }
-
- @Override
- public void onUserListDeletion(final User listOwner, final UserList list) {
- }
-
- @Override
- public void onUserListMemberAddition(final User addedMember, final User listOwner, final UserList list) {
- }
-
- @Override
- public void onUserListMemberDeletion(final User deletedMember, final User listOwner, final UserList list) {
- }
-
- @Override
- public void onUserListSubscription(final User subscriber, final User listOwner, final UserList list) {
- }
-
- @Override
- public void onUserListUnsubscription(final User subscriber, final User listOwner, final UserList list) {
- }
-
- @Override
- public void onUserListUpdate(final User listOwner, final UserList list) {
- }
-
- @Override
- public void onUserProfileUpdate(final User updatedUser) {
- }
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/UserStreamImpl.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/UserStreamImpl.java
deleted file mode 100644
index fde5e1af7..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/UserStreamImpl.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import twitter4j.conf.StreamConfiguration;
-import twitter4j.http.HttpResponse;
-import twitter4j.internal.async.Dispatcher;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.8
- */
-class UserStreamImpl extends StatusStreamImpl implements UserStream {
- /* package */UserStreamImpl(final Dispatcher dispatcher, final HttpResponse response, final StreamConfiguration conf)
- throws IOException {
- super(dispatcher, response, conf);
- }
-
- /* package */UserStreamImpl(final Dispatcher dispatcher, final InputStream stream, final StreamConfiguration conf)
- throws IOException {
- super(dispatcher, stream, conf);
- }
-
- @Override
- public void next(final UserStreamListener listener) throws TwitterException {
- handleNextElement(new StreamListener[] { listener }, EMPTY);
- }
-
- @Override
- protected void onBlock(final JSONObject source, final JSONObject target, final StreamListener[] listeners)
- throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((UserStreamListener) listener).onBlock(asUser(source), asUser(target));
- }
- }
-
- @Override
- protected void onDirectMessage(final JSONObject json, final StreamListener[] listeners) throws TwitterException,
- JSONException {
- final DirectMessage directMessage = asDirectMessage(json);
- for (final StreamListener listener : listeners) {
- ((UserStreamListener) listener).onDirectMessage(directMessage);
- }
- }
-
- @Override
- protected void onFavorite(final JSONObject source, final JSONObject target, final JSONObject targetObject,
- final StreamListener[] listeners) throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((UserStreamListener) listener).onFavorite(asUser(source), asUser(target), asStatus(targetObject));
- }
- }
-
- @Override
- protected void onFollow(final JSONObject source, final JSONObject target, final StreamListener[] listeners)
- throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((UserStreamListener) listener).onFollow(asUser(source), asUser(target));
- }
- }
-
- @Override
- protected void onFriends(final JSONObject json, final StreamListener[] listeners) throws TwitterException,
- JSONException {
- final long[] friendIds = asFriendList(json);
- for (final StreamListener listener : listeners) {
- ((UserStreamListener) listener).onFriendList(friendIds);
- }
- }
-
- @Override
- protected void onScrubGeo(final JSONObject json, final StreamListener[] listeners) throws TwitterException {
- // Not implemented yet
- logger.info("Geo-tagging deletion notice (not implemented yet): " + line);
- }
-
- @Override
- protected void onSender(final JSONObject json, final StreamListener[] listeners) throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((UserStreamListener) listener).onDirectMessage(factory.createDirectMessage(json));
- }
- }
-
- @Override
- protected void onUnblock(final JSONObject source, final JSONObject target, final StreamListener[] listeners)
- throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((UserStreamListener) listener).onUnblock(asUser(source), asUser(target));
- }
- }
-
- @Override
- protected void onUnfavorite(final JSONObject source, final JSONObject target, final JSONObject targetObject,
- final StreamListener[] listeners) throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((UserStreamListener) listener).onUnfavorite(asUser(source), asUser(target), asStatus(targetObject));
- }
- }
-
- @Override
- protected void onUserListCreation(final JSONObject source, final JSONObject target, final StreamListener[] listeners)
- throws TwitterException, JSONException {
- for (final StreamListener listener : listeners) {
- ((UserStreamListener) listener).onUserListCreation(asUser(source), asUserList(target));
- }
- }
-
- @Override
- protected void onUserListDestroyed(final JSONObject source, final JSONObject target,
- final StreamListener[] listeners) throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((UserStreamListener) listener).onUserListDeletion(asUser(source), asUserList(target));
- }
- }
-
- @Override
- protected void onUserListMemberAddition(final JSONObject addedMember, final JSONObject owner,
- final JSONObject target, final StreamListener[] listeners) throws TwitterException, JSONException {
- for (final StreamListener listener : listeners) {
- ((UserStreamListener) listener).onUserListMemberAddition(asUser(addedMember), asUser(owner),
- asUserList(target));
- }
- }
-
- @Override
- protected void onUserListMemberDeletion(final JSONObject deletedMember, final JSONObject owner,
- final JSONObject target, final StreamListener[] listeners) throws TwitterException, JSONException {
- for (final StreamListener listener : listeners) {
- ((UserStreamListener) listener).onUserListMemberDeletion(asUser(deletedMember), asUser(owner),
- asUserList(target));
- }
- }
-
- @Override
- protected void onUserListSubscription(final JSONObject source, final JSONObject owner, final JSONObject target,
- final StreamListener[] listeners) throws TwitterException, JSONException {
- for (final StreamListener listener : listeners) {
- ((UserStreamListener) listener).onUserListSubscription(asUser(source), asUser(owner), asUserList(target));
- }
- }
-
- @Override
- protected void onUserListUnsubscription(final JSONObject source, final JSONObject owner, final JSONObject target,
- final StreamListener[] listeners) throws TwitterException, JSONException {
- for (final StreamListener listener : listeners) {
- ((UserStreamListener) listener).onUserListUnsubscription(asUser(source), asUser(owner), asUserList(target));
- }
- }
-
- @Override
- protected void onUserListUpdated(final JSONObject source, final JSONObject target, final StreamListener[] listeners)
- throws TwitterException, JSONException {
- for (final StreamListener listener : listeners) {
- ((UserStreamListener) listener).onUserListUpdate(asUser(source), asUserList(target));
- }
- }
-
- @Override
- protected void onUserUpdate(final JSONObject source, final JSONObject target, final StreamListener[] listeners)
- throws TwitterException {
- for (final StreamListener listener : listeners) {
- ((UserStreamListener) listener).onUserProfileUpdate(asUser(source));
- }
- }
-
-}
\ No newline at end of file
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/UserStreamListener.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/UserStreamListener.java
deleted file mode 100644
index b7bf4b7e3..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/UserStreamListener.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-/**
- * @author yusuke at mac.com
- * @since Twitter4J 2.1.3
- */
-public interface UserStreamListener extends StatusListener {
- /**
- * @param source
- * @param blockedUser
- * @since Twitter4J 2.1.3
- */
- void onBlock(User source, User blockedUser);
-
- void onDeletionNotice(long directMessageId, long userId);
-
- /**
- * @param directMessage
- * @since Twitter4J 2.1.3
- */
- void onDirectMessage(DirectMessage directMessage);
-
- /**
- * @param source
- * @param target
- * @param favoritedStatus
- * @since Twitter4J 2.1.3
- */
- void onFavorite(User source, User target, Status favoritedStatus);
-
- /**
- * @param source
- * @param followedUser
- * @since Twitter4J 2.1.3
- */
- void onFollow(User source, User followedUser);
-
- /**
- * @param friendIds
- * @since Twitter4J 2.1.3
- */
- void onFriendList(long[] friendIds);
-
- /**
- * @param source
- * @param unblockedUser
- * @since Twitter4J 2.1.3
- */
- void onUnblock(User source, User unblockedUser);
-
- /**
- * @param source
- * @param target
- * @param unfavoritedStatus
- * @since Twitter4J 2.1.3
- */
- void onUnfavorite(User source, User target, Status unfavoritedStatus);
-
- /**
- * @param listOwner
- * @param list
- * @since Twitter4J 2.1.3
- */
- void onUserListCreation(User listOwner, UserList list);
-
- /**
- * @param listOwner
- * @param list
- * @since Twitter4J 2.1.3
- */
- void onUserListDeletion(User listOwner, UserList list);
-
- /**
- * @param addedMember
- * @param listOwner
- * @param list
- * @since Twitter4J 2.1.11
- */
- void onUserListMemberAddition(User addedMember, User listOwner, UserList list);
-
- /**
- * @param deletedMember
- * @param listOwner
- * @param list
- * @since Twitter4J 2.1.11
- */
- void onUserListMemberDeletion(User deletedMember, User listOwner, UserList list);
-
- /**
- * @param subscriber
- * @param listOwner
- * @param list
- * @since Twitter4J 2.1.3
- */
- void onUserListSubscription(User subscriber, User listOwner, UserList list);
-
- /**
- * @param subscriber
- * @param listOwner
- * @param list
- * @since Twitter4J 2.1.11
- */
- void onUserListUnsubscription(User subscriber, User listOwner, UserList list);
-
- /**
- * @param listOwner
- * @param list
- * @since Twitter4J 2.1.3
- */
- void onUserListUpdate(User listOwner, UserList list);
-
- /**
- * @param updatedUser updated user
- * @since Twitter4J 2.1.9
- */
- void onUserProfileUpdate(User updatedUser);
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/VersionStream.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/VersionStream.java
deleted file mode 100644
index 591324a8a..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/VersionStream.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- */
-public final class VersionStream {
- private static final String VERSION = "3.0.3";
- private static final String TITLE = "Twitter4J Streaming API support";
-
- private VersionStream() {
- throw new AssertionError();
- }
-
- public static String getVersion() {
- return VERSION;
- }
-
- /**
- * prints the version string
- *
- * @param args will be just ignored.
- */
- public static void main(final String[] args) {
- System.out.println(TITLE + " " + VERSION);
- }
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/BaseStreamConfigurationFactory.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/BaseStreamConfigurationFactory.java
deleted file mode 100644
index edfd5918a..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/BaseStreamConfigurationFactory.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j.conf;
-
-/**
- * ConfigurationFactory implementation for ConfigurationBase. Currently
- * getInstance calls concrete constructor each time. No caching at all.
- *
- * @author Yusuke Yamamoto - yusuke at mac.com
- */
-class BaseStreamConfigurationFactory implements StreamConfigurationFactory {
- private static final StreamConfigurationBase ROOT_CONFIGURATION;
-
- static {
- ROOT_CONFIGURATION = new StreamConfigurationBase();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void dispose() {
- // nothing to do for property based configuration
- }
-
- // It may be preferable to cache the config instance
-
- /**
- * {@inheritDoc}
- */
- @Override
- public StreamConfiguration getInstance() {
- return ROOT_CONFIGURATION;
- }
-
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/StreamConfiguration.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/StreamConfiguration.java
deleted file mode 100644
index 1ba0da502..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/StreamConfiguration.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package twitter4j.conf;
-
-public interface StreamConfiguration extends Configuration {
-
- int getAsyncNumThreads();
-
- String getDispatcherImpl();
-
- int getHttpStreamingReadTimeout();
-
- String getSiteStreamBaseURL();
-
- String getStreamBaseURL();
-
- String getUserStreamBaseURL();
-
- boolean isJSONStoreEnabled();
-
- boolean isStallWarningsEnabled();
-
- boolean isUserStreamRepliesAllEnabled();
-
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/StreamConfigurationBase.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/StreamConfigurationBase.java
deleted file mode 100644
index d0e83a5ef..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/StreamConfigurationBase.java
+++ /dev/null
@@ -1,153 +0,0 @@
-package twitter4j.conf;
-
-import twitter4j.TwitterStreamConstants;
-
-class StreamConfigurationBase extends ConfigurationBase implements StreamConfiguration, TwitterStreamConstants {
-
- private String dispatcherImpl;
- private String siteStreamBaseURL;
- private String userStreamBaseURL;
- private String streamBaseURL;
-
- private int httpStreamingReadTimeout;
- private int asyncNumThreads;
-
- private boolean userStreamRepliesAllEnabled;
- private boolean jsonStoreEnabled;
- private boolean stallWarningsEnabled;
-
- protected StreamConfigurationBase() {
- super();
- setAsyncNumThreads(1);
- setHttpStreamingReadTimeout(40 * 1000);
- setDispatcherImpl("twitter4j.internal.async.DispatcherImpl");
- setStreamBaseURL(DEFAULT_STREAM_BASE_URL);
- setUserStreamBaseURL(DEFAULT_USER_STREAM_BASE_URL);
- setSiteStreamBaseURL(DEFAULT_SITE_STREAM_BASE_URL);
- setUserStreamRepliesAllEnabled(false);
- }
-
- @Override
- public final int getAsyncNumThreads() {
- return asyncNumThreads;
- }
-
- @Override
- public String getDispatcherImpl() {
- return dispatcherImpl;
- }
-
- @Override
- public int getHttpStreamingReadTimeout() {
- return httpStreamingReadTimeout;
- }
-
- @Override
- public String getSiteStreamBaseURL() {
- return siteStreamBaseURL;
- }
-
- @Override
- public String getStreamBaseURL() {
- return streamBaseURL;
- }
-
- @Override
- public String getUserStreamBaseURL() {
- return userStreamBaseURL;
- }
-
- @Override
- public boolean isJSONStoreEnabled() {
- return jsonStoreEnabled;
- }
-
- @Override
- public boolean isStallWarningsEnabled() {
- return stallWarningsEnabled;
- }
-
- @Override
- public boolean isUserStreamRepliesAllEnabled() {
- return userStreamRepliesAllEnabled;
- }
-
- public void setStallWarningsEnabled(final boolean isStallWarningsEnabled) {
- stallWarningsEnabled = isStallWarningsEnabled;
- }
-
- protected final void setAsyncNumThreads(final int asyncNumThreads) {
- this.asyncNumThreads = asyncNumThreads;
- }
-
- protected final void setDispatcherImpl(final String dispatcherImpl) {
- this.dispatcherImpl = dispatcherImpl;
- }
-
- protected final void setHttpStreamingReadTimeout(final int httpStreamingReadTimeout) {
- this.httpStreamingReadTimeout = httpStreamingReadTimeout;
- }
-
- protected final void setJSONStoreEnabled(final boolean enabled) {
- jsonStoreEnabled = enabled;
- }
-
- protected final void setSiteStreamBaseURL(String siteStreamBaseURL) {
- if (isNullOrEmpty(siteStreamBaseURL)) {
- siteStreamBaseURL = DEFAULT_SITE_STREAM_BASE_URL;
- }
- this.siteStreamBaseURL = fixURLSlash(siteStreamBaseURL);
- fixSiteStreamBaseURL();
- }
-
- protected final void setStreamBaseURL(String streamBaseURL) {
- if (isNullOrEmpty(streamBaseURL)) {
- streamBaseURL = DEFAULT_STREAM_BASE_URL;
- }
- this.streamBaseURL = fixURLSlash(streamBaseURL);
- fixStreamBaseURL();
- }
-
- protected final void setUserStreamBaseURL(String userStreamBaseURL) {
- if (isNullOrEmpty(userStreamBaseURL)) {
- userStreamBaseURL = DEFAULT_USER_STREAM_BASE_URL;
- }
- this.userStreamBaseURL = fixURLSlash(userStreamBaseURL);
- fixUserStreamBaseURL();
- }
-
- protected final void setUserStreamRepliesAllEnabled(final boolean enabled) {
- userStreamRepliesAllEnabled = enabled;
- }
-
- private void fixSiteStreamBaseURL() {
- if (DEFAULT_SITE_STREAM_BASE_URL.equals(fixURL(DEFAULT_USE_SSL, siteStreamBaseURL))) {
- siteStreamBaseURL = fixURL(isSSLEnabled(), siteStreamBaseURL);
- }
- if (siteStreamBaseURL != null && siteStreamBaseURL.equals(fixURL(DEFAULT_USE_SSL, siteStreamBaseURL))) {
- siteStreamBaseURL = fixURL(isSSLEnabled(), siteStreamBaseURL);
- }
- initRequestHeaders();
- }
-
- private void fixStreamBaseURL() {
- if (DEFAULT_STREAM_BASE_URL.equals(fixURL(DEFAULT_USE_SSL, streamBaseURL))) {
- streamBaseURL = fixURL(isSSLEnabled(), streamBaseURL);
- }
- if (streamBaseURL != null && streamBaseURL.equals(fixURL(DEFAULT_USE_SSL, streamBaseURL))) {
- streamBaseURL = fixURL(isSSLEnabled(), streamBaseURL);
- }
- initRequestHeaders();
- }
-
- private void fixUserStreamBaseURL() {
- if (DEFAULT_USER_STREAM_BASE_URL.equals(fixURL(DEFAULT_USE_SSL, userStreamBaseURL))) {
- userStreamBaseURL = fixURL(isSSLEnabled(), userStreamBaseURL);
- }
- if (userStreamBaseURL != null && userStreamBaseURL.equals(fixURL(DEFAULT_USE_SSL, userStreamBaseURL))) {
- userStreamBaseURL = fixURL(isSSLEnabled(), userStreamBaseURL);
- }
- initRequestHeaders();
- }
-
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/StreamConfigurationBuilder.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/StreamConfigurationBuilder.java
deleted file mode 100644
index 6d09f7339..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/StreamConfigurationBuilder.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * Twidere - Twitter client for Android
- *
- * Copyright (C) 2012-2015 Mariotaku Lee
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package twitter4j.conf;
-
-import twitter4j.http.HostAddressResolverFactory;
-import twitter4j.http.HttpClientFactory;
-
-/**
- * A builder that can be used to construct a twitter4j configuration with
- * desired settings. This builder has sensible defaults such that
- * {@code new ConfigurationBuilder().build()} would create a usable
- * configuration. This configuration builder is useful for clients that wish to
- * configure twitter4j in unit tests or from command line flags for example.
- *
- * @author John Sirois - john.sirois at gmail.com
- */
-@SuppressWarnings("unused")
-public final class StreamConfigurationBuilder {
-
- private StreamConfigurationBase configuration = new StreamConfigurationBase();
-
- public StreamConfiguration build() {
- checkNotBuilt();
- configuration.cacheInstance();
- try {
- return configuration;
- } finally {
- configuration = null;
- }
- }
-
- public StreamConfigurationBuilder setAsyncNumThreads(final int asyncNumThreads) {
- checkNotBuilt();
- configuration.setAsyncNumThreads(asyncNumThreads);
- return this;
- }
-
- public StreamConfigurationBuilder setClientName(final String clientName) {
- checkNotBuilt();
- configuration.setClientName(clientName);
- return this;
- }
-
- public StreamConfigurationBuilder setClientURL(final String clientURL) {
- checkNotBuilt();
- configuration.setClientURL(clientURL);
- return this;
- }
-
- public StreamConfigurationBuilder setClientVersion(final String clientVersion) {
- checkNotBuilt();
- configuration.setClientVersion(clientVersion);
- return this;
- }
-
- public StreamConfigurationBuilder setDebugEnabled(final boolean debugEnabled) {
- checkNotBuilt();
- configuration.setDebug(debugEnabled);
- return this;
- }
-
- public StreamConfigurationBuilder setDispatcherImpl(final String dispatcherImpl) {
- checkNotBuilt();
- configuration.setDispatcherImpl(dispatcherImpl);
- return this;
- }
-
- public StreamConfigurationBuilder setGZIPEnabled(final boolean gzipEnabled) {
- checkNotBuilt();
- configuration.setGZIPEnabled(gzipEnabled);
- return this;
- }
-
- public StreamConfigurationBuilder setHostAddressResolverFactory(final HostAddressResolverFactory factory) {
- checkNotBuilt();
- configuration.setHostAddressResolverFactory(factory);
- return this;
- }
-
- public void setHttpClientFactory(HttpClientFactory factory) {
- configuration.setHttpClientFactory(factory);
- }
-
- public StreamConfigurationBuilder setHttpConnectionTimeout(final int httpConnectionTimeout) {
- checkNotBuilt();
- configuration.setHttpConnectionTimeout(httpConnectionTimeout);
- return this;
- }
-
- public StreamConfigurationBuilder setHttpDefaultMaxPerRoute(final int httpDefaultMaxPerRoute) {
- checkNotBuilt();
- configuration.setHttpDefaultMaxPerRoute(httpDefaultMaxPerRoute);
- return this;
- }
-
- public StreamConfigurationBuilder setHttpMaxTotalConnections(final int httpMaxConnections) {
- checkNotBuilt();
- configuration.setHttpMaxTotalConnections(httpMaxConnections);
- return this;
- }
-
- public StreamConfigurationBuilder setHttpProxyHost(final String httpProxyHost) {
- checkNotBuilt();
- configuration.setHttpProxyHost(httpProxyHost);
- return this;
- }
-
- public StreamConfigurationBuilder setHttpProxyPassword(final String httpProxyPassword) {
- checkNotBuilt();
- configuration.setHttpProxyPassword(httpProxyPassword);
- return this;
- }
-
- public StreamConfigurationBuilder setHttpProxyPort(final int httpProxyPort) {
- checkNotBuilt();
- configuration.setHttpProxyPort(httpProxyPort);
- return this;
- }
-
- public StreamConfigurationBuilder setHttpProxyUser(final String httpProxyUser) {
- checkNotBuilt();
- configuration.setHttpProxyUser(httpProxyUser);
- return this;
- }
-
- public StreamConfigurationBuilder setHttpReadTimeout(final int httpReadTimeout) {
- checkNotBuilt();
- configuration.setHttpReadTimeout(httpReadTimeout);
- return this;
- }
-
- public StreamConfigurationBuilder setHttpRetryCount(final int httpRetryCount) {
- checkNotBuilt();
- configuration.setHttpRetryCount(httpRetryCount);
- return this;
- }
-
- public StreamConfigurationBuilder setHttpRetryIntervalSeconds(final int httpRetryIntervalSeconds) {
- checkNotBuilt();
- configuration.setHttpRetryIntervalSeconds(httpRetryIntervalSeconds);
- return this;
- }
-
- public StreamConfigurationBuilder setHttpStreamingReadTimeout(final int httpStreamingReadTimeout) {
- checkNotBuilt();
- configuration.setHttpStreamingReadTimeout(httpStreamingReadTimeout);
- return this;
- }
-
- public StreamConfigurationBuilder setIgnoreSSLError(final boolean ignoreSSLError) {
- checkNotBuilt();
- configuration.setIgnoreSSLError(ignoreSSLError);
- return this;
- }
-
- public StreamConfigurationBuilder setIncludeEntitiesEnabled(final boolean enabled) {
- checkNotBuilt();
- configuration.setIncludeEntitiesEnabled(enabled);
- return this;
- }
-
- public StreamConfigurationBuilder setIncludeRTsEnabled(final boolean enabled) {
- checkNotBuilt();
- configuration.setIncludeRTsEnabled(enabled);
- return this;
- }
-
- public StreamConfigurationBuilder setJSONStoreEnabled(final boolean enabled) {
- checkNotBuilt();
- configuration.setJSONStoreEnabled(enabled);
- return this;
- }
-
- public StreamConfigurationBuilder setOAuthAccessToken(final String oAuthAccessToken) {
- checkNotBuilt();
- configuration.setOAuthAccessToken(oAuthAccessToken);
- return this;
- }
-
- public StreamConfigurationBuilder setOAuthAccessTokenSecret(final String oAuthAccessTokenSecret) {
- checkNotBuilt();
- configuration.setOAuthAccessTokenSecret(oAuthAccessTokenSecret);
- return this;
- }
-
- public StreamConfigurationBuilder setOAuthBaseURL(final String oAuthBaseURL) {
- checkNotBuilt();
- configuration.setOAuthBaseURL(oAuthBaseURL);
- return this;
- }
-
- public StreamConfigurationBuilder setOAuthConsumerKey(final String oAuthConsumerKey) {
- checkNotBuilt();
- configuration.setOAuthConsumerKey(oAuthConsumerKey);
- return this;
- }
-
- public StreamConfigurationBuilder setOAuthConsumerSecret(final String oAuthConsumerSecret) {
- checkNotBuilt();
- configuration.setOAuthConsumerSecret(oAuthConsumerSecret);
- return this;
- }
-
- public StreamConfigurationBuilder setPassword(final String password) {
- checkNotBuilt();
- configuration.setPassword(password);
- return this;
- }
-
- public StreamConfigurationBuilder setPrettyDebugEnabled(final boolean prettyDebugEnabled) {
- checkNotBuilt();
- configuration.setPrettyDebugEnabled(prettyDebugEnabled);
- return this;
- }
-
- public StreamConfigurationBuilder setRestBaseURL(final String restBaseURL) {
- checkNotBuilt();
- configuration.setRestBaseURL(restBaseURL);
- return this;
- }
-
- public StreamConfigurationBuilder setSigningOAuthBaseURL(final String signingOAuthBaseURL) {
- checkNotBuilt();
- configuration.setSigningOAuthBaseURL(signingOAuthBaseURL);
- return this;
- }
-
- public StreamConfigurationBuilder setSigningRestBaseURL(final String signingRestBaseURL) {
- checkNotBuilt();
- configuration.setSigningRestBaseURL(signingRestBaseURL);
- return this;
- }
-
- public StreamConfigurationBuilder setSiteStreamBaseURL(final String siteStreamBaseURL) {
- checkNotBuilt();
- configuration.setSiteStreamBaseURL(siteStreamBaseURL);
- return this;
- }
-
- public StreamConfigurationBuilder setStreamBaseURL(final String streamBaseURL) {
- checkNotBuilt();
- configuration.setStreamBaseURL(streamBaseURL);
- return this;
- }
-
- public StreamConfigurationBuilder setUser(final String user) {
- checkNotBuilt();
- configuration.setUser(user);
- return this;
- }
-
- public StreamConfigurationBuilder setHttpUserAgent(final String userAgent) {
- checkNotBuilt();
- configuration.setHttpUserAgent(userAgent);
- return this;
- }
-
- public StreamConfigurationBuilder setUserStreamBaseURL(final String siteStreamBaseURL) {
- checkNotBuilt();
- configuration.setUserStreamBaseURL(siteStreamBaseURL);
- return this;
- }
-
- public StreamConfigurationBuilder setUserStreamRepliesAllEnabled(final boolean enabled) {
- checkNotBuilt();
- configuration.setUserStreamRepliesAllEnabled(enabled);
- return this;
- }
-
- public StreamConfigurationBuilder setUseSSL(final boolean useSSL) {
- checkNotBuilt();
- configuration.setUseSSL(useSSL);
- return this;
- }
-
- private void checkNotBuilt() {
- if (configuration == null)
- throw new IllegalStateException("Cannot use this builder any longer, build() has already been called");
- }
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/StreamConfigurationContext.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/StreamConfigurationContext.java
deleted file mode 100644
index 0a8cc61d6..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/StreamConfigurationContext.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package twitter4j.conf;
-
-public class StreamConfigurationContext {
- private static final StreamConfigurationFactory factory = new BaseStreamConfigurationFactory();
-
- public static StreamConfiguration getInstance() {
- return factory.getInstance();
- }
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/StreamConfigurationFactory.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/StreamConfigurationFactory.java
deleted file mode 100644
index afa14abfe..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/conf/StreamConfigurationFactory.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package twitter4j.conf;
-
-public interface StreamConfigurationFactory extends ConfigurationFactory {
-
- /**
- * returns the root configuration
- *
- * @return root configuration
- */
- @Override
- StreamConfiguration getInstance();
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/internal/async/Dispatcher.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/internal/async/Dispatcher.java
deleted file mode 100644
index 4906b41ac..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/internal/async/Dispatcher.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j.internal.async;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- */
-public interface Dispatcher {
-
- void invokeLater(Runnable task);
-
- void shutdown();
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/internal/async/DispatcherFactory.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/internal/async/DispatcherFactory.java
deleted file mode 100644
index 9dc1da024..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/internal/async/DispatcherFactory.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j.internal.async;
-
-import java.lang.reflect.InvocationTargetException;
-
-import twitter4j.conf.StreamConfiguration;
-import twitter4j.conf.StreamConfigurationContext;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.2
- */
-public final class DispatcherFactory {
- private final String dispatcherImpl;
- private final StreamConfiguration conf;
-
- public DispatcherFactory() {
- this(StreamConfigurationContext.getInstance());
- }
-
- public DispatcherFactory(final StreamConfiguration conf) {
- dispatcherImpl = conf.getDispatcherImpl();
- this.conf = conf;
- }
-
- /**
- * returns a Dispatcher instance.
- *
- * @return dispatcher instance
- */
- public Dispatcher getInstance() {
- try {
- return (Dispatcher) Class.forName(dispatcherImpl).getConstructor(StreamConfiguration.class)
- .newInstance(conf);
- } catch (final InstantiationException e) {
- throw new AssertionError(e);
- } catch (final IllegalAccessException e) {
- throw new AssertionError(e);
- } catch (final ClassNotFoundException e) {
- throw new AssertionError(e);
- } catch (final ClassCastException e) {
- throw new AssertionError(e);
- } catch (final NoSuchMethodException e) {
- throw new AssertionError(e);
- } catch (final InvocationTargetException e) {
- throw new AssertionError(e);
- }
- }
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/internal/async/DispatcherImpl.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/internal/async/DispatcherImpl.java
deleted file mode 100644
index 5d07abf3a..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/internal/async/DispatcherImpl.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package twitter4j.internal.async;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import twitter4j.conf.StreamConfiguration;
-import twitter4j.internal.logging.Logger;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.2
- */
-final class DispatcherImpl implements Dispatcher {
- private final ExecuteThread[] threads;
- private final List q = new LinkedList();
-
- final Object ticket = new Object();
-
- private boolean active = true;
-
- public DispatcherImpl(final StreamConfiguration conf) {
- threads = new ExecuteThread[conf.getAsyncNumThreads()];
- for (int i = 0; i < threads.length; i++) {
- threads[i] = new ExecuteThread("Twitter4J Async Dispatcher", this, i);
- threads[i].setDaemon(true);
- threads[i].start();
- }
- Runtime.getRuntime().addShutdownHook(new Thread() {
- @Override
- public void run() {
- if (active) {
- shutdown();
- }
- }
- });
- }
-
- @Override
- public synchronized void invokeLater(final Runnable task) {
- synchronized (q) {
- q.add(task);
- }
- synchronized (ticket) {
- ticket.notify();
- }
- }
-
- public Runnable poll() {
- while (active) {
- synchronized (q) {
- if (q.size() > 0) {
- final Runnable task = q.remove(0);
- if (task != null) return task;
- }
- }
- synchronized (ticket) {
- try {
- ticket.wait();
- } catch (final InterruptedException ignore) {
- }
- }
- }
- return null;
- }
-
- @Override
- public synchronized void shutdown() {
- if (active) {
- active = false;
- for (final ExecuteThread thread : threads) {
- thread.shutdown();
- }
- synchronized (ticket) {
- ticket.notify();
- }
- }
- }
-}
-
-class ExecuteThread extends Thread {
- private static Logger logger = Logger.getLogger(DispatcherImpl.class);
- DispatcherImpl q;
-
- private boolean alive = true;
-
- ExecuteThread(final String name, final DispatcherImpl q, final int index) {
- super(name + "[" + index + "]");
- this.q = q;
- }
-
- @Override
- public void run() {
- while (alive) {
- final Runnable task = q.poll();
- if (task != null) {
- try {
- task.run();
- } catch (final Exception ex) {
- logger.error("Got an exception while running a task:", ex);
- }
- }
- }
- }
-
- public void shutdown() {
- alive = false;
- }
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/internal/json/DataObjectFactoryUtil.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/internal/json/DataObjectFactoryUtil.java
deleted file mode 100644
index d4d734710..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/internal/json/DataObjectFactoryUtil.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j.internal.json;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import twitter4j.json.DataObjectFactory;
-
-/**
- * provides public access to package private methods of
- * twitter4j.json.DataObjectFactory class.
- * This class is not intended to be used by Twitter4J client.
- *
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.7
- */
-public class DataObjectFactoryUtil {
- private static final Method CLEAR_THREAD_LOCAL_MAP;
-
- private static final Method REGISTER_JSON_OBJECT;
- static {
- final Method[] methods = DataObjectFactory.class.getDeclaredMethods();
- Method clearThreadLocalMap = null;
- Method registerJSONObject = null;
- for (final Method method : methods) {
- if (method.getName().equals("clearThreadLocalMap")) {
- clearThreadLocalMap = method;
- clearThreadLocalMap.setAccessible(true);
- } else if (method.getName().equals("registerJSONObject")) {
- registerJSONObject = method;
- registerJSONObject.setAccessible(true);
- }
- }
- if (null == clearThreadLocalMap || null == registerJSONObject) throw new AssertionError();
- CLEAR_THREAD_LOCAL_MAP = clearThreadLocalMap;
- REGISTER_JSON_OBJECT = registerJSONObject;
- }
-
- private DataObjectFactoryUtil() {
- throw new AssertionError("not intended to be instantiated.");
- }
-
- /**
- * provides a public access to {DAOFactory#clearThreadLocalMap}
- */
- public static void clearThreadLocalMap() {
- try {
- CLEAR_THREAD_LOCAL_MAP.invoke(null);
- } catch (final IllegalAccessException e) {
- throw new AssertionError(e);
- } catch (final InvocationTargetException e) {
- throw new AssertionError(e);
- }
- }
-
- /**
- * provides a public access to {DAOFactory#registerJSONObject}
- */
- @SuppressWarnings("unchecked")
- public static T registerJSONObject(final T key, final Object json) {
- try {
- return (T) REGISTER_JSON_OBJECT.invoke(null, key, json);
- } catch (final IllegalAccessException e) {
- throw new AssertionError(e);
- } catch (final InvocationTargetException e) {
- throw new AssertionError(e);
- }
- }
-}
diff --git a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/json/DataObjectFactory.java b/twidere.component.twitter4j.streaming/src/main/java/twitter4j/json/DataObjectFactory.java
deleted file mode 100644
index 67c78190d..000000000
--- a/twidere.component.twitter4j.streaming/src/main/java/twitter4j/json/DataObjectFactory.java
+++ /dev/null
@@ -1,595 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j.json;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import twitter4j.AccountTotals;
-import twitter4j.Category;
-import twitter4j.DirectMessage;
-import twitter4j.IDs;
-import twitter4j.Location;
-import twitter4j.OEmbed;
-import twitter4j.Place;
-import twitter4j.RateLimitStatus;
-import twitter4j.Relationship;
-import twitter4j.SavedSearch;
-import twitter4j.Status;
-import twitter4j.StatusDeletionNotice;
-import twitter4j.Trend;
-import twitter4j.Trends;
-import twitter4j.TwitterException;
-import twitter4j.User;
-import twitter4j.UserList;
-
-/**
- * @author Yusuke Yamamoto - yusuke at mac.com
- * @since Twitter4J 2.1.7
- */
-@SuppressWarnings("unchecked")
-public final class DataObjectFactory {
- private static final Constructor statusConstructor;
-
- private static final Constructor userConstructor;
- private static final Constructor relationshipConstructor;
- private static final Constructor placeConstructor;
- private static final Constructor savedSearchConstructor;
- private static final Constructor trendConstructor;
- private static final Constructor trendsConstructor;
- private static final Constructor IDsConstructor;
- private static final Method rateLimitStatusConstructor;
- private static final Constructor categoryConstructor;
- private static final Constructor directMessageConstructor;
- private static final Constructor locationConstructor;
- private static final Constructor userListConstructor;
- private static final Constructor statusDeletionNoticeConstructor;
- private static final Constructor accountTotalsConstructor;
- private static final Constructor oembedConstructor;
- static {
- try {
- statusConstructor = (Constructor) Class.forName("twitter4j.internal.json.StatusJSONImpl")
- .getDeclaredConstructor(JSONObject.class);
- statusConstructor.setAccessible(true);
-
- userConstructor = (Constructor) Class.forName("twitter4j.internal.json.UserJSONImpl")
- .getDeclaredConstructor(JSONObject.class);
- userConstructor.setAccessible(true);
-
- relationshipConstructor = (Constructor) Class.forName(
- "twitter4j.internal.json.RelationshipJSONImpl").getDeclaredConstructor(JSONObject.class);
- relationshipConstructor.setAccessible(true);
-
- placeConstructor = (Constructor) Class.forName("twitter4j.internal.json.PlaceJSONImpl")
- .getDeclaredConstructor(JSONObject.class);
- placeConstructor.setAccessible(true);
-
- savedSearchConstructor = (Constructor) Class.forName(
- "twitter4j.internal.json.SavedSearchJSONImpl").getDeclaredConstructor(JSONObject.class);
- savedSearchConstructor.setAccessible(true);
-
- trendConstructor = (Constructor) Class.forName("twitter4j.internal.json.TrendJSONImpl")
- .getDeclaredConstructor(JSONObject.class);
- trendConstructor.setAccessible(true);
-
- trendsConstructor = (Constructor) Class.forName("twitter4j.internal.json.TrendsJSONImpl")
- .getDeclaredConstructor(String.class);
- trendsConstructor.setAccessible(true);
-
- IDsConstructor = (Constructor) Class.forName("twitter4j.internal.json.IDsJSONImpl")
- .getDeclaredConstructor(String.class);
- IDsConstructor.setAccessible(true);
-
- rateLimitStatusConstructor = Class.forName("twitter4j.internal.json.RateLimitStatusJSONImpl")
- .getDeclaredMethod("createRateLimitStatuses", JSONObject.class);
- rateLimitStatusConstructor.setAccessible(true);
-
- categoryConstructor = (Constructor) Class.forName("twitter4j.internal.json.CategoryJSONImpl")
- .getDeclaredConstructor(JSONObject.class);
- categoryConstructor.setAccessible(true);
-
- directMessageConstructor = (Constructor) Class.forName(
- "twitter4j.internal.json.DirectMessageJSONImpl").getDeclaredConstructor(JSONObject.class);
- directMessageConstructor.setAccessible(true);
-
- locationConstructor = (Constructor) Class.forName("twitter4j.internal.json.LocationJSONImpl")
- .getDeclaredConstructor(JSONObject.class);
- locationConstructor.setAccessible(true);
-
- userListConstructor = (Constructor) Class.forName("twitter4j.internal.json.UserListJSONImpl")
- .getDeclaredConstructor(JSONObject.class);
- userListConstructor.setAccessible(true);
-
- statusDeletionNoticeConstructor = (Constructor) Class.forName(
- "twitter4j.StatusDeletionNoticeImpl").getDeclaredConstructor(JSONObject.class);
- statusDeletionNoticeConstructor.setAccessible(true);
-
- accountTotalsConstructor = (Constructor) Class.forName(
- "twitter4j.internal.json.AccountTotalsJSONImpl").getDeclaredConstructor(JSONObject.class);
- accountTotalsConstructor.setAccessible(true);
- oembedConstructor = (Constructor) Class.forName("twitter4j.internal.json.OEmbedJSONImpl")
- .getDeclaredConstructor(JSONObject.class);
- oembedConstructor.setAccessible(true);
- } catch (final NoSuchMethodException e) {
- throw new ExceptionInInitializerError(e);
- } catch (final ClassNotFoundException e) {
- throw new ExceptionInInitializerError(e);
- }
- }
-
- @SuppressWarnings("rawtypes")
- private static final ThreadLocal