diff --git a/LICENSE.txt b/LICENSE.txt index cf0d8e0e3..6b5c2d522 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,26 +1,179 @@ -Twitter4J includes software from JSON.org to parse JSON response from the Twitter API. You can see the license term at http://www.JSON.org/license.html - -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +Twitter4J SUBCOMPONENTS: + +Twitter4J includes software from JSON.org to parse JSON response from the Twitter API. You can see the license term at http://www.JSON.org/license.html \ No newline at end of file diff --git a/twitter4j-core/src/main/java/twitter4j/AbstractStreamImplementation.java b/twitter4j-core/src/main/java/twitter4j/AbstractStreamImplementation.java index ca5d2d144..d2701674b 100644 --- a/twitter4j-core/src/main/java/twitter4j/AbstractStreamImplementation.java +++ b/twitter4j-core/src/main/java/twitter4j/AbstractStreamImplementation.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.conf.Configuration; diff --git a/twitter4j-core/src/main/java/twitter4j/AccountSettings.java b/twitter4j-core/src/main/java/twitter4j/AccountSettings.java index 38d6a41b0..c6701bd56 100644 --- a/twitter4j-core/src/main/java/twitter4j/AccountSettings.java +++ b/twitter4j-core/src/main/java/twitter4j/AccountSettings.java @@ -1,59 +1,57 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; /** * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.1.9 */ -public interface AccountSettings extends TwitterResponse, java.io.Serializable { +public interface AccountSettings extends TwitterResponse, java.io.Serializable { /** * Returns true if the user enabled sleep time. + * * @return true if the user enabled sleep time */ boolean isSleepTimeEnabled(); /** * Returns sleep start time. + * * @return sleep start time */ String getSleepStartTime(); + /** * Returns sleep end time. + * * @return sleep end time */ String getSleepEndTime(); + /** * Return the user's trend locations + * * @return the user's trend locations */ Location[] getTrendLocations(); + /** * Return true if the user is enabling geo location + * * @return true if the user is enabling geo location */ boolean isGeoEnabled(); diff --git a/twitter4j-core/src/main/java/twitter4j/AccountSettingsJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/AccountSettingsJSONImpl.java index cfed169a5..c6f44b65a 100644 --- a/twitter4j-core/src/main/java/twitter4j/AccountSettingsJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/AccountSettingsJSONImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import twitter4j.internal.http.HttpResponse; @@ -58,7 +48,7 @@ private AccountSettingsJSONImpl(HttpResponse res, JSONObject json) throws Twitte } else { JSONArray locations = json.getJSONArray("trend_location"); TREND_LOCATION = new Location[locations.length()]; - for(int i=0;iAnnotations Overview | dev.twitter.com + * @since Twitter4J 2.1.4 */ public class Annotation implements Comparable, java.io.Serializable { - private static final long serialVersionUID = -6515375141284988754L; - private String type = null; - private Map attributes = null; - - /** - * Construct an Annotation with a type but no attributes - * @param type - the type - */ - public Annotation(String type) { - setType(type); - setAttributes(null); - } - - /** - * Construct an Annotation with a type and attributes - * @param type - * @param attributes - */ - public Annotation(String type, Map attributes) { - setType(type); - setAttributes(attributes); - } - - /** + private static final long serialVersionUID = -6515375141284988754L; + private String type = null; + private Map attributes = null; + + /** + * Construct an Annotation with a type but no attributes + * + * @param type - the type + */ + public Annotation(String type) { + setType(type); + setAttributes(null); + } + + /** + * Construct an Annotation with a type and attributes + * + * @param type + * @param attributes + */ + public Annotation(String type, Map attributes) { + setType(type); + setAttributes(attributes); + } + + /** * Construct an Annotation instance from a JSON Object, returned from Twitter API * Package visibility only! - * @param jsonObject - the JSON Object - */ - Annotation(JSONObject jsonObject) { - String typ = null; - Map attrs = null; - Iterator it = jsonObject.keys(); - if (it.hasNext()) { - typ = (String)it.next(); - // we expect only one key - the type; if there are more it's a malformed JSON object - if (it.hasNext()) { - type = null; - } else { - try { - JSONObject jo = jsonObject.getJSONObject(typ); - attrs = new LinkedHashMap(); - it = jo.keys(); - while (it.hasNext()) { - String key = (String)it.next(); - String value = jo.getString(key); - attrs.put(key, value); - } - } catch (JSONException jsone) { - // clear all - typ = null; - attrs = null; - } - } - } - setType(typ); - setAttributes(attrs); - } + * + * @param jsonObject - the JSON Object + */ + Annotation(JSONObject jsonObject) { + String typ = null; + Map attrs = null; + Iterator it = jsonObject.keys(); + if (it.hasNext()) { + typ = (String) it.next(); + // we expect only one key - the type; if there are more it's a malformed JSON object + if (it.hasNext()) { + type = null; + } else { + try { + JSONObject jo = jsonObject.getJSONObject(typ); + attrs = new LinkedHashMap(); + it = jo.keys(); + while (it.hasNext()) { + String key = (String) it.next(); + String value = jo.getString(key); + attrs.put(key, value); + } + } catch (JSONException jsone) { + // clear all + typ = null; + attrs = null; + } + } + } + setType(typ); + setAttributes(attrs); + } /** * @return the type */ public String getType() { - return type; + return type; } - + /** * Sets the type * Ensures the class's property is not null + * * @param type - the type */ public void setType(String type) { - this.type = (type == null) ? "" : type; + this.type = (type == null) ? "" : type; } - + /** * Sets the type * Ensures the class's property is not null + * * @param type - the type * @return this (for coding convenience) */ public Annotation type(String type) { - setType(type); - return this; + setType(type); + return this; } /** * @return the attributes */ public Map getAttributes() { - return attributes; + return attributes; } - + /** * Sets the attributes * Ensures the class's property is not null + * * @param attributes - the attributes */ public void setAttributes(Map attributes) { - this.attributes = (attributes == null) ? - new LinkedHashMap() : attributes; - } + this.attributes = (attributes == null) ? + new LinkedHashMap() : attributes; + } /** * Sets the attributes * Ensures the class's property is not null + * * @param attributes - the attributes * @return this (for coding convenience) */ public Annotation attributes(Map attributes) { - setAttributes(attributes); - return this; - } - + setAttributes(attributes); + return this; + } + /** * Adds a single attribute - * @param name - the attribute name + * + * @param name - the attribute name * @param value - the attribute value */ public void addAttribute(String name, String value) { - this.attributes.put(name, value); + this.attributes.put(name, value); } - + /** * Adds a single attribute - * @param name - the attribute name + * + * @param name - the attribute name * @param value - the attribute value * @return this (for coding convenience) */ public Annotation attribute(String name, String value) { - addAttribute(name, value); - return this; + addAttribute(name, value); + return this; + } + + /** + * @return true if the attributes are empty, false otherwise + */ + public boolean isEmpty() { + return attributes.isEmpty(); } - - /** - * @return true if the attributes are empty, false otherwise - */ - public boolean isEmpty() { - return attributes.isEmpty(); - } - /** - * @return true the number of attributes - */ + /** + * @return true the number of attributes + */ public Integer size() { - return attributes.size(); + return attributes.size(); } - - /** - * Package visibility only! - * @return the JSON String representation of this - */ - String asParameterValue() { - return asJSONObject().toString(); + + /** + * Package visibility only! + * + * @return the JSON String representation of this + */ + String asParameterValue() { + return asJSONObject().toString(); } - - /** - * Package visibility only! - * Converts this to a JSON object according to Twitter's specification - * @return the JSON Object - */ - JSONObject asJSONObject() { - JSONObject jsonObject = new JSONObject(); - try { - jsonObject.put(type, attributes); - } catch (JSONException ignore) { - } - return jsonObject; - } - - /* (non-Javadoc) - * @see java.lang.Comparable#compareTo(java.lang.Object) - */ - public int compareTo(Annotation other) { - // Precedence of order: - // 1. Type - // 2. Number of attributes - // 3. Sorted attributes - For each attribute: name, then value + + /** + * Package visibility only! + * Converts this to a JSON object according to Twitter's specification + * + * @return the JSON Object + */ + JSONObject asJSONObject() { + JSONObject jsonObject = new JSONObject(); + try { + jsonObject.put(type, attributes); + } catch (JSONException ignore) { + } + return jsonObject; + } + + /* (non-Javadoc) + * @see java.lang.Comparable#compareTo(java.lang.Object) + */ + public int compareTo(Annotation other) { + // Precedence of order: + // 1. Type + // 2. Number of attributes + // 3. Sorted attributes - For each attribute: name, then value if (null == other) { return 1; } if (this == other) { return 0; } - int result = this.getType().compareTo(other.getType()); - if (result != 0) { - return result; - } - result = this.size().compareTo(other.size()); - if (result != 0) { - return result; - } - - Iterator thisNamesIt = this.sortedNames().iterator(); - Iterator otherNamesIt = other.sortedNames().iterator(); - - while (thisNamesIt.hasNext()) { - String thisName = thisNamesIt.next(); - String otherName = otherNamesIt.next(); - result = thisName.compareTo(otherName); - if (result != 0) { - return result; - } - String thisValue = this.getAttributes().get(thisName); - String otherValue = other.getAttributes().get(otherName); - result = thisValue.compareTo(otherValue); - if (result != 0) { - return result; - } - } - return 0; - } + int result = this.getType().compareTo(other.getType()); + if (result != 0) { + return result; + } + result = this.size().compareTo(other.size()); + if (result != 0) { + return result; + } - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { + Iterator thisNamesIt = this.sortedNames().iterator(); + Iterator otherNamesIt = other.sortedNames().iterator(); + + while (thisNamesIt.hasNext()) { + String thisName = thisNamesIt.next(); + String otherName = otherNamesIt.next(); + result = thisName.compareTo(otherName); + if (result != 0) { + return result; + } + String thisValue = this.getAttributes().get(thisName); + String otherValue = other.getAttributes().get(otherName); + result = thisValue.compareTo(otherValue); + if (result != 0) { + return result; + } + } + return 0; + } + + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { if (null == obj) { return false; } @@ -267,37 +268,37 @@ public boolean equals(Object obj) { return true; } if (!(obj instanceof Annotation)) { - return false; + return false; } Annotation other = (Annotation) obj; // Map comparison ignores the order of the map entries - // which is exactly what we want here for the attributes - return ((this.getType().equals(other.getType())) && - (this.getAttributes().equals(other.getAttributes()))); - } + return ((this.getType().equals(other.getType())) && + (this.getAttributes().equals(other.getAttributes()))); + } /* (non-Javadoc) * @see java.lang.Object#hashCode() */ @Override public int hashCode() { - return ((31 * type.hashCode()) + attributes.hashCode()); + return ((31 * type.hashCode()) + attributes.hashCode()); } - + @Override public String toString() { StringBuffer sb = new StringBuffer("Annotation{type='"); sb.append(type).append("', attributes={"); Iterator nameIt = attributes.keySet().iterator(); while (nameIt.hasNext()) { - String name = nameIt.next(); - String value = attributes.get(name); - sb.append('\'').append(name).append("'='").append(value).append('\''); - if (nameIt.hasNext()) { - sb.append(", "); - } + String name = nameIt.next(); + String value = attributes.get(name); + sb.append('\'').append(name).append("'='").append(value).append('\''); + if (nameIt.hasNext()) { + sb.append(", "); + } } - sb.append("}}"); + sb.append("}}"); return sb.toString(); } @@ -305,9 +306,9 @@ public String toString() { * @return a sorted set of the attributes' names */ private SortedSet sortedNames() { - SortedSet names = new TreeSet(); - names.addAll(getAttributes().keySet()); - return names; + SortedSet names = new TreeSet(); + names.addAll(getAttributes().keySet()); + return names; } } diff --git a/twitter4j-core/src/main/java/twitter4j/Annotations.java b/twitter4j-core/src/main/java/twitter4j/Annotations.java index cd4fa52fa..5c86301ac 100644 --- a/twitter4j-core/src/main/java/twitter4j/Annotations.java +++ b/twitter4j-core/src/main/java/twitter4j/Annotations.java @@ -1,164 +1,160 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.org.json.JSONArray; +import twitter4j.internal.org.json.JSONException; + import java.util.ArrayList; import java.util.Collections; import java.util.List; -import twitter4j.internal.org.json.JSONArray; -import twitter4j.internal.org.json.JSONException; - /** * A data class representing the Annotations of a Status or a Tweet * * @author Roy Reshef - royreshef at gmail.com - * @since Twitter4J 2.1.4 * @see Annotations Overview | dev.twitter.com + * @since Twitter4J 2.1.4 */ public class Annotations implements java.io.Serializable { - private static final long serialVersionUID = 7928827620306593741L; - public static final int lengthLimit = 512; - private List annotations = null; + private static final long serialVersionUID = 7928827620306593741L; + public static final int lengthLimit = 512; + private List annotations = null; /** * Construct empty Annotations instance */ public Annotations() { - setAnnotations(null); + setAnnotations(null); } - + /** * Construct Annotations instance from an exisiting List of Annotation instances + * * @param annotations - the List of Annotation instances */ public Annotations(List annotations) { - setAnnotations(annotations); + setAnnotations(annotations); } - + /** * Construct Annotations instance from a JSON Array, returned from Twitter API * Package visibility only! + * * @param jsonArray - the JSON Array */ Annotations(JSONArray jsonArray) { - setAnnotations(null); - try { - for (int i = 0; i < jsonArray.length(); i++) { - addAnnotation(new Annotation(jsonArray.getJSONObject(i))); - } - } catch (JSONException jsone) { - // malformed JSONObject - just empty the list of Annotations - annotations.clear(); - } - } - + setAnnotations(null); + try { + for (int i = 0; i < jsonArray.length(); i++) { + addAnnotation(new Annotation(jsonArray.getJSONObject(i))); + } + } catch (JSONException jsone) { + // malformed JSONObject - just empty the list of Annotations + annotations.clear(); + } + } + /** * @return the List of Annotation instances */ public List getAnnotations() { - return annotations; + return annotations; } /** * Sets the List of Annotation instances * Ensures the class's property is not null + * * @param annotations - the List of Annotation instances */ public void setAnnotations(List annotations) { - this.annotations = - (annotations == null) ? new ArrayList() : annotations; - } - - /** - * Adds a single Annotation to the List of Annotation instances - * @param annotation - the Annotation to add - */ - public void addAnnotation(Annotation annotation) { - this.annotations.add(annotation); - } + this.annotations = + (annotations == null) ? new ArrayList() : annotations; + } /** - * Adds a single Annotation to the List of Annotation instances - * @param annotation - the Annotation to add + * Adds a single Annotation to the List of Annotation instances + * + * @param annotation - the Annotation to add + */ + public void addAnnotation(Annotation annotation) { + this.annotations.add(annotation); + } + + /** + * Adds a single Annotation to the List of Annotation instances + * + * @param annotation - the Annotation to add * @return this (for coding convenience) */ public Annotations annotation(Annotation annotation) { - addAnnotation(annotation); - return this; + addAnnotation(annotation); + return this; + } + + /** + * @return true if the List of Annotation instances is empty, false otherwise + */ + public boolean isEmpty() { + return annotations.isEmpty(); } - - /** - * @return true if the List of Annotation instances is empty, false otherwise - */ - public boolean isEmpty() { - return annotations.isEmpty(); - } /** - * @return the number of Annotation instances in the List + * @return the number of Annotation instances in the List */ public Integer size() { - return annotations.size(); - } - - /** - * @param annotations - the instance to test - * @return true if the JSON String representation of the instance exceeds the limit imposed by Twitter, false otherwise - */ - public static boolean isExceedingLengthLimit(Annotations annotations) { - return (annotations.asParameterValue().length() > lengthLimit); - } - - /** - * @return true if the JSON String representation of this exceeds the limit imposed by Twitter, false otherwise - */ - public boolean isExceedingLengthLimit() { - return isExceedingLengthLimit(this); - } - - /** - * Package visibility only! - * @return the JSON String representation of this - */ - String asParameterValue() { - JSONArray jsonArray = new JSONArray(); - for (Annotation annotation : annotations) { - jsonArray.put(annotation.asJSONObject()); - } - return jsonArray.toString(); - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { + return annotations.size(); + } + + /** + * @param annotations - the instance to test + * @return true if the JSON String representation of the instance exceeds the limit imposed by Twitter, false otherwise + */ + public static boolean isExceedingLengthLimit(Annotations annotations) { + return (annotations.asParameterValue().length() > lengthLimit); + } + + /** + * @return true if the JSON String representation of this exceeds the limit imposed by Twitter, false otherwise + */ + public boolean isExceedingLengthLimit() { + return isExceedingLengthLimit(this); + } + + /** + * Package visibility only! + * + * @return the JSON String representation of this + */ + String asParameterValue() { + JSONArray jsonArray = new JSONArray(); + for (Annotation annotation : annotations) { + jsonArray.put(annotation.asJSONObject()); + } + return jsonArray.toString(); + } + + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { if (null == obj) { return false; } @@ -167,44 +163,44 @@ public boolean equals(Object obj) { } // shouldn't use the List directly as the Annotations are equal // regardless of the order of the Annotation instances - return ((obj instanceof Annotations) && - ((Annotations) obj).getSortedAnnotations().equals(this.getSortedAnnotations())); - } + return ((obj instanceof Annotations) && + ((Annotations) obj).getSortedAnnotations().equals(this.getSortedAnnotations())); + } /* (non-Javadoc) * @see java.lang.Object#hashCode() */ @Override public int hashCode() { - return getSortedAnnotations().hashCode(); + return getSortedAnnotations().hashCode(); } - + /* (non-Javadoc) - * @see java.lang.Object#toString() - */ + * @see java.lang.Object#toString() + */ @Override public String toString() { StringBuffer sb = new StringBuffer("Annotations{"); - for (int i = 0; i < size() ; i++) { - if (i > 0) { - sb.append(", "); - } - sb.append(annotations.get(i).toString()); + for (int i = 0; i < size(); i++) { + if (i > 0) { + sb.append(", "); + } + sb.append(annotations.get(i).toString()); } sb.append('}'); - + return sb.toString(); } - + /** * @return a sorted copy of the List of Annotation instances */ private List getSortedAnnotations() { - // create a new list - we do not want to change the order in the original one - List sortedAnnotations = new ArrayList(size()); - sortedAnnotations.addAll(this.annotations); - Collections.sort(sortedAnnotations); - return sortedAnnotations; + // create a new list - we do not want to change the order in the original one + List sortedAnnotations = new ArrayList(size()); + sortedAnnotations.addAll(this.annotations); + Collections.sort(sortedAnnotations); + return sortedAnnotations; } } diff --git a/twitter4j-core/src/main/java/twitter4j/AsyncTwitter.java b/twitter4j-core/src/main/java/twitter4j/AsyncTwitter.java index 241820d8a..de3585020 100644 --- a/twitter4j-core/src/main/java/twitter4j/AsyncTwitter.java +++ b/twitter4j-core/src/main/java/twitter4j/AsyncTwitter.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.api.*; diff --git a/twitter4j-core/src/main/java/twitter4j/AsyncTwitterFactory.java b/twitter4j-core/src/main/java/twitter4j/AsyncTwitterFactory.java index 5897f9140..14fd0bd93 100644 --- a/twitter4j-core/src/main/java/twitter4j/AsyncTwitterFactory.java +++ b/twitter4j-core/src/main/java/twitter4j/AsyncTwitterFactory.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import twitter4j.conf.Configuration; diff --git a/twitter4j-core/src/main/java/twitter4j/Category.java b/twitter4j-core/src/main/java/twitter4j/Category.java index e81488368..3ba629d90 100644 --- a/twitter4j-core/src/main/java/twitter4j/Category.java +++ b/twitter4j-core/src/main/java/twitter4j/Category.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; /** @@ -32,6 +22,8 @@ */ public interface Category { String getName(); + String getSlug(); + int getSize(); } diff --git a/twitter4j-core/src/main/java/twitter4j/CategoryJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/CategoryJSONImpl.java index 8c1fef540..541ad6491 100644 --- a/twitter4j-core/src/main/java/twitter4j/CategoryJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/CategoryJSONImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpResponse; @@ -85,7 +75,6 @@ public String getSlug() { } /** - * * @return * @since Twitter4J 2.1.9 */ diff --git a/twitter4j-core/src/main/java/twitter4j/ConnectionLifeCycleListener.java b/twitter4j-core/src/main/java/twitter4j/ConnectionLifeCycleListener.java index ac3203062..8ab4d06e3 100644 --- a/twitter4j-core/src/main/java/twitter4j/ConnectionLifeCycleListener.java +++ b/twitter4j-core/src/main/java/twitter4j/ConnectionLifeCycleListener.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; /** diff --git a/twitter4j-core/src/main/java/twitter4j/CursorSupport.java b/twitter4j-core/src/main/java/twitter4j/CursorSupport.java index fa5759058..76be329db 100644 --- a/twitter4j-core/src/main/java/twitter4j/CursorSupport.java +++ b/twitter4j-core/src/main/java/twitter4j/CursorSupport.java @@ -1,56 +1,41 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; /** - * * @author Yusuke Yamamoto - yusuke at mac.com */ public interface CursorSupport { /** - * * @since Twitter4J 2.0.10 */ boolean hasPrevious(); /** - * * @since Twitter4J 2.0.10 */ long getPreviousCursor(); /** - * * @since Twitter4J 2.0.10 */ boolean hasNext(); /** - * * @since Twitter4J 2.0.10 */ long getNextCursor(); diff --git a/twitter4j-core/src/main/java/twitter4j/DirectMessage.java b/twitter4j-core/src/main/java/twitter4j/DirectMessage.java index 46c0d1437..790f6be67 100644 --- a/twitter4j-core/src/main/java/twitter4j/DirectMessage.java +++ b/twitter4j-core/src/main/java/twitter4j/DirectMessage.java @@ -1,34 +1,26 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.Date; + /** * A data interface representing sent/received direct message. + * * @author Yusuke Yamamoto - yusuke at mac.com */ public interface DirectMessage extends TwitterResponse, java.io.Serializable { diff --git a/twitter4j-core/src/main/java/twitter4j/DirectMessageJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/DirectMessageJSONImpl.java index 163099fe6..9fae9bf49 100644 --- a/twitter4j-core/src/main/java/twitter4j/DirectMessageJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/DirectMessageJSONImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpResponse; @@ -33,9 +23,15 @@ import twitter4j.internal.org.json.JSONObject; import java.util.Date; -import static twitter4j.internal.util.ParseUtil.*; + +import static twitter4j.internal.util.ParseUtil.getDate; +import static twitter4j.internal.util.ParseUtil.getInt; +import static twitter4j.internal.util.ParseUtil.getLong; +import static twitter4j.internal.util.ParseUtil.getUnescapedString; + /** * A data class representing sent/received direct message. + * * @author Yusuke Yamamoto - yusuke at mac.com */ /*package*/ final class DirectMessageJSONImpl extends TwitterResponseImpl implements DirectMessage, java.io.Serializable { @@ -56,10 +52,12 @@ DataObjectFactoryUtil.clearThreadLocalMap(); DataObjectFactoryUtil.registerJSONObject(this, json); } + /*package*/DirectMessageJSONImpl(JSONObject json) throws TwitterException { init(json); } - private void init(JSONObject json) throws TwitterException{ + + private void init(JSONObject json) throws TwitterException { id = getLong("id", json); text = getUnescapedString("text", json); senderId = getInt("sender_id", json); @@ -142,7 +140,8 @@ public User getRecipient() { return recipient; } - /*package*/ static ResponseList createDirectMessageList(HttpResponse res) throws TwitterException { + /*package*/ + static ResponseList createDirectMessageList(HttpResponse res) throws TwitterException { try { DataObjectFactoryUtil.clearThreadLocalMap(); JSONArray list = res.asJSONArray(); @@ -165,7 +164,7 @@ public User getRecipient() { @Override public int hashCode() { - return (int)id; + return (int) id; } @Override diff --git a/twitter4j-core/src/main/java/twitter4j/ExceptionDiagnosis.java b/twitter4j-core/src/main/java/twitter4j/ExceptionDiagnosis.java index db058b66f..7a5f3587d 100644 --- a/twitter4j-core/src/main/java/twitter4j/ExceptionDiagnosis.java +++ b/twitter4j-core/src/main/java/twitter4j/ExceptionDiagnosis.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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; /** @@ -47,9 +37,9 @@ final class ExceptionDiagnosis implements java.io.Serializable { StackTraceElement[] stackTrace = th.getStackTrace(); stackLineHash = 0; lineNumberHash = 0; - for(int i=stackTrace.length-1;i>=0;i--){ + for (int i = stackTrace.length - 1; i >= 0; i--) { StackTraceElement line = stackTrace[i]; - for(String filter : inclusionFilter){ + for (String filter : inclusionFilter) { if (line.getClassName().startsWith(filter)) { int hash = line.getClassName().hashCode() + line.getMethodName().hashCode(); stackLineHash = 31 * stackLineHash + hash; @@ -59,7 +49,7 @@ final class ExceptionDiagnosis implements java.io.Serializable { } } hexString += toHexString(stackLineHash) + "-" + toHexString(lineNumberHash); - if(null != th.getCause()){ + if (null != th.getCause()) { this.hexString += " " + new ExceptionDiagnosis(th.getCause(), inclusionFilter).asHexString(); } @@ -77,16 +67,18 @@ String getStackLineHashAsHex() { int getLineNumberHash() { return lineNumberHash; } - String getLineNumberHashAsHex(){ + + String getLineNumberHashAsHex() { return toHexString(lineNumberHash); } String asHexString() { return hexString; } - private String toHexString(int value){ + + private String toHexString(int value) { String str = "0000000" + Integer.toHexString(value); - return str.substring(str.length()-8,str.length()); + return str.substring(str.length() - 8, str.length()); } @Override diff --git a/twitter4j-core/src/main/java/twitter4j/FilterQuery.java b/twitter4j-core/src/main/java/twitter4j/FilterQuery.java index fd08303a5..1d18af75c 100644 --- a/twitter4j-core/src/main/java/twitter4j/FilterQuery.java +++ b/twitter4j-core/src/main/java/twitter4j/FilterQuery.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpParameter; diff --git a/twitter4j-core/src/main/java/twitter4j/Friendship.java b/twitter4j-core/src/main/java/twitter4j/Friendship.java index 0b6ac49d9..57b1a12f0 100644 --- a/twitter4j-core/src/main/java/twitter4j/Friendship.java +++ b/twitter4j-core/src/main/java/twitter4j/Friendship.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; /** @@ -32,8 +22,12 @@ */ public interface Friendship extends java.io.Serializable { int getId(); + String getName(); + String getScreenName(); + boolean isFollowing(); + boolean isFollowedBy(); } diff --git a/twitter4j-core/src/main/java/twitter4j/FriendshipJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/FriendshipJSONImpl.java index 2339a2424..dd72b469f 100644 --- a/twitter4j-core/src/main/java/twitter4j/FriendshipJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/FriendshipJSONImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpResponse; @@ -72,7 +62,8 @@ class FriendshipJSONImpl implements Friendship { } } - /*package*/ static ResponseList createFriendshipList(HttpResponse res) throws TwitterException { + /*package*/ + static ResponseList createFriendshipList(HttpResponse res) throws TwitterException { try { DataObjectFactoryUtil.clearThreadLocalMap(); JSONArray list = res.asJSONArray(); diff --git a/twitter4j-core/src/main/java/twitter4j/GeoLocation.java b/twitter4j-core/src/main/java/twitter4j/GeoLocation.java index a6ad85299..2364723c5 100644 --- a/twitter4j-core/src/main/java/twitter4j/GeoLocation.java +++ b/twitter4j-core/src/main/java/twitter4j/GeoLocation.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import twitter4j.internal.org.json.JSONArray; diff --git a/twitter4j-core/src/main/java/twitter4j/GeoQuery.java b/twitter4j-core/src/main/java/twitter4j/GeoQuery.java index 47b691eaf..0b65618e8 100644 --- a/twitter4j-core/src/main/java/twitter4j/GeoQuery.java +++ b/twitter4j-core/src/main/java/twitter4j/GeoQuery.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpParameter; @@ -48,18 +38,20 @@ public final class GeoQuery implements java.io.Serializable { /** * Creates a GeoQuery with the specified location + * * @param location */ - public GeoQuery(GeoLocation location){ + public GeoQuery(GeoLocation location) { this.location = location; this.ip = null; } /** * Creates a GeoQuery with the specified IP address + * * @param ip IP address */ - public GeoQuery(String ip){ + public GeoQuery(String ip) { this.ip = ip; this.location = null; } @@ -78,6 +70,7 @@ public String getAccuracy() { /** * Sets a hint on the "region" in which to search. If a number, then this is a radius in meters, but it can also take a string that is suffixed with ft to specify feet. If this is not passed in, then it is assumed to be 0m. If coming from a device, in practice, this value is whatever accuracy the device has measuring its location (whether it be coming from a GPS, WiFi triangulation, etc.). + * * @param accuracy a hint on the "region" in which to search. */ public void setAccuracy(String accuracy) { @@ -95,6 +88,7 @@ public String getGranularity() { /** * Sets the minimal granularity of data to return. If this is not passed in, then neighborhood is assumed. city can also be passed. + * * @param granularity the minimal granularity of data to return */ public void setGranularity(String granularity) { @@ -112,23 +106,26 @@ public int getMaxResults() { /** * Sets a hint as to the number of results to return. This does not guarantee that the number of results returned will equal max_results, but instead informs how many "nearby" results to return. Ideally, only pass in the number of places you intend to display to the user here. + * * @param maxResults A hint as to the number of results to return. */ public void setMaxResults(int maxResults) { this.maxResults = maxResults; } + public GeoQuery maxResults(int maxResults) { setMaxResults(maxResults); return this; } - /*package*/ HttpParameter[] asHttpParameterArray(){ + + /*package*/ HttpParameter[] asHttpParameterArray() { ArrayList params = new ArrayList(); - if(null != location){ + if (null != location) { appendParameter("lat", location.getLatitude(), params); appendParameter("long", location.getLongitude(), params); } - if(null != ip){ + if (null != ip) { appendParameter("ip", ip, params); } @@ -146,10 +143,11 @@ private void appendParameter(String name, String value, List para } private void appendParameter(String name, int value, List params) { - if(0 < value){ + if (0 < value) { params.add(new HttpParameter(name, String.valueOf(value))); } } + private void appendParameter(String name, double value, List params) { params.add(new HttpParameter(name, String.valueOf(value))); } diff --git a/twitter4j-core/src/main/java/twitter4j/HashtagEntity.java b/twitter4j-core/src/main/java/twitter4j/HashtagEntity.java index 59bbf4aad..da64ba34b 100644 --- a/twitter4j-core/src/main/java/twitter4j/HashtagEntity.java +++ b/twitter4j-core/src/main/java/twitter4j/HashtagEntity.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; /** @@ -32,7 +22,7 @@ * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.1.9 */ -public interface HashtagEntity extends java.io.Serializable{ +public interface HashtagEntity extends java.io.Serializable { /** * Returns the text of the hashtag without #. * diff --git a/twitter4j-core/src/main/java/twitter4j/HashtagEntityJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/HashtagEntityJSONImpl.java index 386e26d21..8bdba5213 100644 --- a/twitter4j-core/src/main/java/twitter4j/HashtagEntityJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/HashtagEntityJSONImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.org.json.JSONArray; @@ -32,6 +22,7 @@ /** * A data class representing one single Hashtag entity. + * * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.1.9 */ diff --git a/twitter4j-core/src/main/java/twitter4j/IDs.java b/twitter4j-core/src/main/java/twitter4j/IDs.java index 9cb775290..1b4bca669 100644 --- a/twitter4j-core/src/main/java/twitter4j/IDs.java +++ b/twitter4j-core/src/main/java/twitter4j/IDs.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; diff --git a/twitter4j-core/src/main/java/twitter4j/IDsJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/IDsJSONImpl.java index df31bd3a5..3f7cc57e0 100644 --- a/twitter4j-core/src/main/java/twitter4j/IDsJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/IDsJSONImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpResponse; diff --git a/twitter4j-core/src/main/java/twitter4j/Location.java b/twitter4j-core/src/main/java/twitter4j/Location.java index 904cd168f..a0eeafd57 100644 --- a/twitter4j-core/src/main/java/twitter4j/Location.java +++ b/twitter4j-core/src/main/java/twitter4j/Location.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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; /** @@ -31,10 +21,16 @@ */ public interface Location extends java.io.Serializable { int getWoeid(); + String getCountryName(); + String getCountryCode(); + String getPlaceName(); + int getPlaceCode(); + String getName(); + String getURL(); } diff --git a/twitter4j-core/src/main/java/twitter4j/LocationJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/LocationJSONImpl.java index 18f92fb54..a65f9fd78 100644 --- a/twitter4j-core/src/main/java/twitter4j/LocationJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/LocationJSONImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpResponse; @@ -69,12 +59,14 @@ } } - /*package*/ static ResponseList createLocationList(HttpResponse res) throws TwitterException { + /*package*/ + static ResponseList createLocationList(HttpResponse res) throws TwitterException { DataObjectFactoryUtil.clearThreadLocalMap(); return createLocationList(res.asJSONArray()); } - /*package*/ static ResponseList createLocationList(JSONArray list) throws TwitterException { + /*package*/ + static ResponseList createLocationList(JSONArray list) throws TwitterException { try { int size = list.length(); ResponseList locations = diff --git a/twitter4j-core/src/main/java/twitter4j/PagableResponseList.java b/twitter4j-core/src/main/java/twitter4j/PagableResponseList.java index 6a8b9a493..55adbba46 100644 --- a/twitter4j-core/src/main/java/twitter4j/PagableResponseList.java +++ b/twitter4j-core/src/main/java/twitter4j/PagableResponseList.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; /** diff --git a/twitter4j-core/src/main/java/twitter4j/PagableResponseListImpl.java b/twitter4j-core/src/main/java/twitter4j/PagableResponseListImpl.java index 59f22be88..058e25bf4 100644 --- a/twitter4j-core/src/main/java/twitter4j/PagableResponseListImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/PagableResponseListImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import twitter4j.internal.http.HttpResponse; diff --git a/twitter4j-core/src/main/java/twitter4j/Paging.java b/twitter4j-core/src/main/java/twitter4j/Paging.java index acb21cf7a..b0ea89b6d 100644 --- a/twitter4j-core/src/main/java/twitter4j/Paging.java +++ b/twitter4j-core/src/main/java/twitter4j/Paging.java @@ -1,34 +1,24 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpParameter; -import java.util.*; +import java.util.ArrayList; import java.util.List; /** @@ -62,9 +52,10 @@ public final class Paging implements java.io.Serializable { } private static HttpParameter[] NULL_PARAMETER_ARRAY = new HttpParameter[0]; + /*package*/ HttpParameter[] asPostParameterArray() { List list = asPostParameterList(SMCP, COUNT); - if(list.size() == 0){ + if (list.size() == 0) { return NULL_PARAMETER_ARRAY; } return list.toArray(new HttpParameter[list.size()]); @@ -76,11 +67,13 @@ public final class Paging implements java.io.Serializable { private static List NULL_PARAMETER_LIST = new ArrayList(0); + /** * Converts the pagination parameters into a List of PostParameter.
* This method also Validates the preset parameters, and throws - * IllegalStateException if any unsupported parameter is set. - * @param supportedParams char array representation of supported parameters + * IllegalStateException if any unsupported parameter is set. + * + * @param supportedParams char array representation of supported parameters * @param perPageParamName name used for per-page parameter. getUserListStatuses() requires "per_page" instead of "count". * @return list of PostParameter */ @@ -100,8 +93,9 @@ public final class Paging implements java.io.Serializable { /** * Converts the pagination parameters into a List of PostParameter.
* This method also Validates the preset parameters, and throws - * IllegalStateException if any unsupported parameter is set. - * @param supportedParams char array representation of supported parameters + * IllegalStateException if any unsupported parameter is set. + * + * @param supportedParams char array representation of supported parameters * @param perPageParamName name used for per-page parameter. getUserListStatuses() requires "per_page" instead of "count". * @return list of PostParameter */ diff --git a/twitter4j-core/src/main/java/twitter4j/PlaceJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/PlaceJSONImpl.java index 73adbf93f..59cd7a99d 100644 --- a/twitter4j-core/src/main/java/twitter4j/PlaceJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/PlaceJSONImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpResponse; @@ -64,15 +54,18 @@ final class PlaceJSONImpl extends TwitterResponseImpl implements Place, java.io. DataObjectFactoryUtil.clearThreadLocalMap(); DataObjectFactoryUtil.registerJSONObject(this, json); } + PlaceJSONImpl(JSONObject json, HttpResponse res) throws TwitterException { super(res); init(json); } + PlaceJSONImpl(JSONObject json) throws TwitterException { super(); init(json); } - private void init(JSONObject json) throws TwitterException{ + + private void init(JSONObject json) throws TwitterException { try { name = getUnescapedString("name", json); streetAddress = getUnescapedString("street_address", json); @@ -92,32 +85,32 @@ private void init(JSONObject json) throws TwitterException{ boundingBoxCoordinates = null; } - if(!json.isNull("geometry")){ + if (!json.isNull("geometry")) { JSONObject geometryJSON = json.getJSONObject("geometry"); geometryType = getRawString("type", geometryJSON); JSONArray array = geometryJSON.getJSONArray("coordinates"); - if(geometryType.equals("Point")){ - geometryCoordinates = new GeoLocation[1][1]; - geometryCoordinates[0][0] = new GeoLocation(array.getDouble(0), array.getDouble(1)); - }else if (geometryType.equals("Polygon")){ - geometryCoordinates = GeoLocation.coordinatesAsGeoLocationArray(array); - }else{ - // MultiPolygon currently unsupported. - geometryType = null; - geometryCoordinates = null; + if (geometryType.equals("Point")) { + geometryCoordinates = new GeoLocation[1][1]; + geometryCoordinates[0][0] = new GeoLocation(array.getDouble(0), array.getDouble(1)); + } else if (geometryType.equals("Polygon")) { + geometryCoordinates = GeoLocation.coordinatesAsGeoLocationArray(array); + } else { + // MultiPolygon currently unsupported. + geometryType = null; + geometryCoordinates = null; } - }else{ + } else { geometryType = null; geometryCoordinates = null; } - if(!json.isNull("contained_within")){ + if (!json.isNull("contained_within")) { JSONArray containedWithInJSON = json.getJSONArray("contained_within"); containedWithIn = new Place[containedWithInJSON.length()]; - for(int i=0;i createPlaceList(HttpResponse res) throws TwitterException { + /*package*/ + static ResponseList createPlaceList(HttpResponse res) throws TwitterException { JSONObject json = null; try { json = res.asJSONObject(); @@ -139,7 +133,8 @@ public int compareTo(Place that) { } } - /*package*/ static ResponseList createPlaceList(JSONArray list, HttpResponse res) throws TwitterException { + /*package*/ + static ResponseList createPlaceList(JSONArray list, HttpResponse res) throws TwitterException { DataObjectFactoryUtil.clearThreadLocalMap(); try { int size = list.length(); @@ -160,43 +155,55 @@ public int compareTo(Place that) { } } - public String getName(){ + public String getName() { return name; } - public String getStreetAddress(){ + + public String getStreetAddress() { return streetAddress; } - public String getCountryCode(){ + + public String getCountryCode() { return countryCode; } - public String getId(){ + + public String getId() { return id; } - public String getCountry(){ + + public String getCountry() { return country; } - public String getPlaceType(){ + + public String getPlaceType() { return placeType; } - public String getURL(){ + + public String getURL() { return url; } - public String getFullName(){ + + public String getFullName() { return fullName; } - public String getBoundingBoxType(){ + + public String getBoundingBoxType() { return boundingBoxType; } - public GeoLocation[][] getBoundingBoxCoordinates(){ + + public GeoLocation[][] getBoundingBoxCoordinates() { return boundingBoxCoordinates; } - public String getGeometryType(){ + + public String getGeometryType() { return geometryType; } - public GeoLocation[][] getGeometryCoordinates(){ + + public GeoLocation[][] getGeometryCoordinates() { return geometryCoordinates; } - public Place[] getContainedWithIn(){ + + public Place[] getContainedWithIn() { return containedWithIn; } diff --git a/twitter4j-core/src/main/java/twitter4j/ProfileImage.java b/twitter4j-core/src/main/java/twitter4j/ProfileImage.java index bc62c9625..d8be49f36 100644 --- a/twitter4j-core/src/main/java/twitter4j/ProfileImage.java +++ b/twitter4j-core/src/main/java/twitter4j/ProfileImage.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.ObjectStreamException; @@ -36,59 +26,60 @@ */ public interface ProfileImage extends TwitterResponse, java.io.Serializable { String getURL(); + ImageSize BIGGER = new ImageSize("bigger"); ImageSize NORMAL = new ImageSize("normal"); ImageSize MINI = new ImageSize("mini"); static class ImageSize implements java.io.Serializable { - private static final Map instances = new HashMap(); + private static final Map instances = new HashMap(); - private static final long serialVersionUID = 3363026523372848987L; + private static final long serialVersionUID = 3363026523372848987L; - private final String name; + private final String name; - private ImageSize() { - throw new AssertionError(); - } + private ImageSize() { + throw new AssertionError(); + } - private ImageSize(String name) { - this.name = name; - instances.put(name, this); - } + private ImageSize(String name) { + this.name = name; + instances.put(name, this); + } - public String getName() { - return name; - } + public String getName() { + return name; + } - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; - ImageSize imageSize = (ImageSize) o; + ImageSize imageSize = (ImageSize) o; - if (!name.equals(imageSize.name)) return false; + if (!name.equals(imageSize.name)) return false; - return true; - } + return true; + } - @Override - public int hashCode() { - return name.hashCode(); - } + @Override + public int hashCode() { + return name.hashCode(); + } - @Override - public String toString() { - return name; - } + @Override + public String toString() { + return name; + } - private static ImageSize getInstance(String name) { - return instances.get(name); - } + private static ImageSize getInstance(String name) { + return instances.get(name); + } - private Object readResolve() throws ObjectStreamException { - return getInstance(name); + private Object readResolve() throws ObjectStreamException { + return getInstance(name); + } } } -} diff --git a/twitter4j-core/src/main/java/twitter4j/ProfileImageImpl.java b/twitter4j-core/src/main/java/twitter4j/ProfileImageImpl.java index 24efba771..113097060 100644 --- a/twitter4j-core/src/main/java/twitter4j/ProfileImageImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/ProfileImageImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import twitter4j.internal.http.HttpResponse; diff --git a/twitter4j-core/src/main/java/twitter4j/Query.java b/twitter4j-core/src/main/java/twitter4j/Query.java index 9816779b9..e0ac97d2b 100644 --- a/twitter4j-core/src/main/java/twitter4j/Query.java +++ b/twitter4j-core/src/main/java/twitter4j/Query.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpParameter; diff --git a/twitter4j-core/src/main/java/twitter4j/QueryResult.java b/twitter4j-core/src/main/java/twitter4j/QueryResult.java index be6724a27..4381bc64c 100644 --- a/twitter4j-core/src/main/java/twitter4j/QueryResult.java +++ b/twitter4j-core/src/main/java/twitter4j/QueryResult.java @@ -1,35 +1,26 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.List; /** * A data interface representing search API response + * * @author Yusuke Yamamoto - yusuke at mac.com */ public interface QueryResult extends java.io.Serializable { diff --git a/twitter4j-core/src/main/java/twitter4j/QueryResultJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/QueryResultJSONImpl.java index d4bd13c33..5a6acb264 100644 --- a/twitter4j-core/src/main/java/twitter4j/QueryResultJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/QueryResultJSONImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpResponse; @@ -33,9 +23,17 @@ import java.util.ArrayList; import java.util.List; -import static twitter4j.internal.util.ParseUtil.*; + +import static twitter4j.internal.util.ParseUtil.getDouble; +import static twitter4j.internal.util.ParseUtil.getInt; +import static twitter4j.internal.util.ParseUtil.getLong; +import static twitter4j.internal.util.ParseUtil.getRawString; +import static twitter4j.internal.util.ParseUtil.getURLDecodedString; +import static twitter4j.internal.util.ParseUtil.getUnescapedString; + /** * A data class representing search API response + * * @author Yusuke Yamamoto - yusuke at mac.com */ /*package*/ final class QueryResultJSONImpl implements QueryResult, java.io.Serializable { @@ -73,6 +71,7 @@ throw new TwitterException(jsone.getMessage() + ":" + json.toString(), jsone); } } + /*package*/ QueryResultJSONImpl(Query query) { super(); sinceId = query.getSinceId(); @@ -151,7 +150,8 @@ public boolean equals(Object o) { QueryResult that = (QueryResult) o; - if (Double.compare(that.getCompletedIn(), completedIn) != 0) return false; + if (Double.compare(that.getCompletedIn(), completedIn) != 0) + return false; if (maxId != that.getMaxId()) return false; if (page != that.getPage()) return false; if (resultsPerPage != that.getResultsPerPage()) return false; diff --git a/twitter4j-core/src/main/java/twitter4j/RateLimitStatus.java b/twitter4j-core/src/main/java/twitter4j/RateLimitStatus.java index 4088afc05..0a5864a11 100644 --- a/twitter4j-core/src/main/java/twitter4j/RateLimitStatus.java +++ b/twitter4j-core/src/main/java/twitter4j/RateLimitStatus.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import java.util.Date; diff --git a/twitter4j-core/src/main/java/twitter4j/RateLimitStatusEvent.java b/twitter4j-core/src/main/java/twitter4j/RateLimitStatusEvent.java index 4da928933..7ab1d3965 100644 --- a/twitter4j-core/src/main/java/twitter4j/RateLimitStatusEvent.java +++ b/twitter4j-core/src/main/java/twitter4j/RateLimitStatusEvent.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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; /** @@ -39,7 +29,7 @@ public final class RateLimitStatusEvent extends java.util.EventObject { private boolean isAccountRateLimitStatus; private static final long serialVersionUID = -2332507741769177298L; - RateLimitStatusEvent(Object source, RateLimitStatus rateLimitStatus, boolean isAccountRateLimitStatus){ + RateLimitStatusEvent(Object source, RateLimitStatus rateLimitStatus, boolean isAccountRateLimitStatus) { super(source); this.rateLimitStatus = rateLimitStatus; this.isAccountRateLimitStatus = isAccountRateLimitStatus; @@ -52,6 +42,7 @@ public RateLimitStatus getRateLimitStatus() { public boolean isAccountRateLimitStatus() { return isAccountRateLimitStatus; } + public boolean isIPRateLimitStatus() { return !isAccountRateLimitStatus; } diff --git a/twitter4j-core/src/main/java/twitter4j/RateLimitStatusJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/RateLimitStatusJSONImpl.java index 7f8cecd45..f504f6695 100644 --- a/twitter4j-core/src/main/java/twitter4j/RateLimitStatusJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/RateLimitStatusJSONImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpResponse; @@ -32,7 +22,8 @@ import java.util.Date; -import static twitter4j.internal.util.ParseUtil.*; +import static twitter4j.internal.util.ParseUtil.getDate; +import static twitter4j.internal.util.ParseUtil.getInt; /** * A data class representing Twitter REST API's rate limit status @@ -64,19 +55,21 @@ private RateLimitStatusJSONImpl(int hourlyLimit, int remainingHits, int resetTim DataObjectFactoryUtil.registerJSONObject(this, json); } + RateLimitStatusJSONImpl(JSONObject json) throws TwitterException { init(json); } + void init(JSONObject json) throws TwitterException { this.hourlyLimit = getInt("hourly_limit", json); - this.remainingHits = getInt("remaining_hits", json); - this.resetTime = getDate("reset_time", json, "EEE MMM d HH:mm:ss Z yyyy"); + this.remainingHits = getInt("remaining_hits", json); + this.resetTime = getDate("reset_time", json, "EEE MMM d HH:mm:ss Z yyyy"); this.resetTimeInSeconds = getInt("reset_time_in_seconds", json); this.secondsUntilReset = (int) ((resetTime.getTime() - System.currentTimeMillis()) / 1000); } static RateLimitStatus createFromResponseHeader(HttpResponse res) { - if(null == res){ + if (null == res) { return null; } int remainingHits;//"X-RateLimit-Remaining" @@ -108,7 +101,7 @@ static RateLimitStatus createFromResponseHeader(HttpResponse res) { } static RateLimitStatus createFeatureSpecificRateLimitStatusFromResponseHeader(HttpResponse res) { - if(null == res){ + if (null == res) { return null; } int remainingHits;//"X-FeatureRateLimit-Remaining" diff --git a/twitter4j-core/src/main/java/twitter4j/RateLimitStatusListener.java b/twitter4j-core/src/main/java/twitter4j/RateLimitStatusListener.java index bce80b1e9..69c7e22a6 100644 --- a/twitter4j-core/src/main/java/twitter4j/RateLimitStatusListener.java +++ b/twitter4j-core/src/main/java/twitter4j/RateLimitStatusListener.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; /** @@ -33,14 +23,16 @@ public interface RateLimitStatusListener { /** * Called when the response contains rate limit status. + * * @param event rate limit status event. */ - public void onRateLimitStatus(RateLimitStatusEvent event); + public void onRateLimitStatus(RateLimitStatusEvent event); /** * Called when the account or IP address is hitting the rate limit.
* onRateLimitStatus will be also called before this event. + * * @param event rate limit status event. */ - public void onRateLimitReached(RateLimitStatusEvent event); + public void onRateLimitReached(RateLimitStatusEvent event); } diff --git a/twitter4j-core/src/main/java/twitter4j/RelatedResults.java b/twitter4j-core/src/main/java/twitter4j/RelatedResults.java index 84bc853c2..fef00312d 100644 --- a/twitter4j-core/src/main/java/twitter4j/RelatedResults.java +++ b/twitter4j-core/src/main/java/twitter4j/RelatedResults.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; /** @@ -34,18 +24,21 @@ public interface RelatedResults extends TwitterResponse, java.io.Serializable { /** * Returns the 8 or less statuses with conversation + * * @return list of statuses with conversation */ ResponseList getTweetsWithConversation(); /** * Returns the 8 or less statuses with reply. + * * @return list of statuses with reply */ ResponseList getTweetsWithReply(); /** * Return the 3 or less latest statuses from the user who sent the origin tweet. + * * @return list of latest statuses */ ResponseList getTweetsFromUser(); diff --git a/twitter4j-core/src/main/java/twitter4j/RelatedResultsJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/RelatedResultsJSONImpl.java index 9d88ebafb..1024315d7 100644 --- a/twitter4j-core/src/main/java/twitter4j/RelatedResultsJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/RelatedResultsJSONImpl.java @@ -1,33 +1,20 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -package twitter4j; + * 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. + */ -import java.util.HashMap; -import java.util.Map; +package twitter4j; import twitter4j.internal.http.HttpResponse; import twitter4j.internal.json.DataObjectFactoryUtil; @@ -35,8 +22,12 @@ import twitter4j.internal.org.json.JSONException; import twitter4j.internal.org.json.JSONObject; +import java.util.HashMap; +import java.util.Map; + /** * A data class representing related_results API response + * * @author Mocel - mocel at guma.jp */ /*package*/ final class RelatedResultsJSONImpl extends TwitterResponseImpl implements RelatedResults, java.io.Serializable { @@ -55,6 +46,7 @@ init(jsonArray, res, true); } + /* package */ RelatedResultsJSONImpl(JSONArray jsonArray) throws TwitterException { super(); init(jsonArray, null, false); @@ -66,13 +58,13 @@ private void init(JSONArray jsonArray, HttpResponse res, boolean registerRawJSON try { for (int i = 0, listLen = jsonArray.length(); i < listLen; ++i) { JSONObject o = jsonArray.getJSONObject(i); - if (! "Tweet".equals(o.getString("resultType"))) { + if (!"Tweet".equals(o.getString("resultType"))) { continue; } String groupName = o.getString("groupName"); if (groupName.length() == 0 - || ! (groupName.equals(TWEETS_WITH_CONVERSATION) || groupName.equals(TWEETS_WITH_REPLY) || groupName.equals(TWEETS_FROM_USER))) { + || !(groupName.equals(TWEETS_WITH_CONVERSATION) || groupName.equals(TWEETS_WITH_REPLY) || groupName.equals(TWEETS_FROM_USER))) { continue; } @@ -86,12 +78,12 @@ private void init(JSONArray jsonArray, HttpResponse res, boolean registerRawJSON for (int j = 0, resultsLen = results.length(); j < resultsLen; ++j) { JSONObject json = results.getJSONObject(j).getJSONObject("value"); Status status = new StatusJSONImpl(json); - if(registerRawJSON){ + if (registerRawJSON) { DataObjectFactoryUtil.registerJSONObject(status, json); } statuses.add(status); } - if(registerRawJSON){ + if (registerRawJSON) { DataObjectFactoryUtil.registerJSONObject(statuses, results); } } diff --git a/twitter4j-core/src/main/java/twitter4j/Relationship.java b/twitter4j-core/src/main/java/twitter4j/Relationship.java index 62f41e12a..bb12fbbf8 100644 --- a/twitter4j-core/src/main/java/twitter4j/Relationship.java +++ b/twitter4j-core/src/main/java/twitter4j/Relationship.java @@ -1,39 +1,30 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; /** * A data interface that has detailed information about a relationship between two users + * * @author Perry Sakkaris - psakkaris at gmail.com * @see GET friendships/show | dev.twitter.com * @since Twitter4J 2.1.0 */ - public interface Relationship extends TwitterResponse, java.io.Serializable { +public interface Relationship extends TwitterResponse, java.io.Serializable { /** * Returns the source user id * @@ -105,5 +96,5 @@ public interface Relationship extends TwitterResponse, java.io.Serializable { * @return true if source user enabled notifications for target user */ boolean isSourceNotificationsEnabled(); - + } diff --git a/twitter4j-core/src/main/java/twitter4j/RelationshipJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/RelationshipJSONImpl.java index 039777c98..640784a54 100644 --- a/twitter4j-core/src/main/java/twitter4j/RelationshipJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/RelationshipJSONImpl.java @@ -1,41 +1,34 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpResponse; import twitter4j.internal.json.DataObjectFactoryUtil; import twitter4j.internal.org.json.JSONArray; -import twitter4j.internal.org.json.JSONObject; import twitter4j.internal.org.json.JSONException; +import twitter4j.internal.org.json.JSONObject; +import static twitter4j.internal.util.ParseUtil.getBoolean; +import static twitter4j.internal.util.ParseUtil.getInt; +import static twitter4j.internal.util.ParseUtil.getUnescapedString; -import static twitter4j.internal.util.ParseUtil.*; /** * A data class that has detailed information about a relationship between two users + * * @author Perry Sakkaris - psakkaris at gmail.com * @see GET friendships/show | dev.twitter.com * @since Twitter4J 2.1.0 @@ -81,7 +74,8 @@ } } - /*package*/ static ResponseList createRelationshipList(HttpResponse res) throws TwitterException { + /*package*/ + static ResponseList createRelationshipList(HttpResponse res) throws TwitterException { try { DataObjectFactoryUtil.clearThreadLocalMap(); JSONArray list = res.asJSONArray(); diff --git a/twitter4j-core/src/main/java/twitter4j/ResponseList.java b/twitter4j-core/src/main/java/twitter4j/ResponseList.java index 66e72f24b..2173ea1f7 100644 --- a/twitter4j-core/src/main/java/twitter4j/ResponseList.java +++ b/twitter4j-core/src/main/java/twitter4j/ResponseList.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import java.util.List; @@ -46,9 +36,9 @@ public interface ResponseList extends TwitterResponse, List { * This method is available in conjunction with Twitter#searchUsers()
* * @return current rate limit status - * @since Twitter4J 2.1.2 * @see Rate Limiting | dev.twitter.com * @see Rate Limiting FAQ | dev.twitter.com + * @since Twitter4J 2.1.2 */ public RateLimitStatus getFeatureSpecificRateLimitStatus(); diff --git a/twitter4j-core/src/main/java/twitter4j/ResponseListImpl.java b/twitter4j-core/src/main/java/twitter4j/ResponseListImpl.java index 0cd49ad76..6f0135eee 100644 --- a/twitter4j-core/src/main/java/twitter4j/ResponseListImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/ResponseListImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import twitter4j.internal.http.HttpResponse; diff --git a/twitter4j-core/src/main/java/twitter4j/SavedSearch.java b/twitter4j-core/src/main/java/twitter4j/SavedSearch.java index 1ec1f8f05..d3686646d 100644 --- a/twitter4j-core/src/main/java/twitter4j/SavedSearch.java +++ b/twitter4j-core/src/main/java/twitter4j/SavedSearch.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.Date; @@ -34,7 +24,7 @@ * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.0.8 */ -public interface SavedSearch extends Comparable, TwitterResponse, java.io.Serializable { +public interface SavedSearch extends Comparable, TwitterResponse, java.io.Serializable { Date getCreatedAt(); String getQuery(); diff --git a/twitter4j-core/src/main/java/twitter4j/SavedSearchJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/SavedSearchJSONImpl.java index 054c6c469..9503fb56d 100644 --- a/twitter4j-core/src/main/java/twitter4j/SavedSearchJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/SavedSearchJSONImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpResponse; @@ -33,7 +23,11 @@ import twitter4j.internal.org.json.JSONObject; import java.util.Date; -import static twitter4j.internal.util.ParseUtil.*; + +import static twitter4j.internal.util.ParseUtil.getDate; +import static twitter4j.internal.util.ParseUtil.getInt; +import static twitter4j.internal.util.ParseUtil.getUnescapedString; + /** * A data class representing a Saved Search * @@ -61,7 +55,8 @@ init(savedSearch); } - /*package*/ static ResponseList createSavedSearchList(HttpResponse res) throws TwitterException { + /*package*/ + static ResponseList createSavedSearchList(HttpResponse res) throws TwitterException { DataObjectFactoryUtil.clearThreadLocalMap(); JSONArray json = res.asJSONArray(); ResponseList savedSearches; @@ -81,11 +76,11 @@ } private void init(JSONObject savedSearch) throws TwitterException { - createdAt = getDate("created_at", savedSearch, "EEE MMM dd HH:mm:ss z yyyy"); - query = getUnescapedString("query", savedSearch); - position = getInt("position", savedSearch); - name = getUnescapedString("name", savedSearch); - id = getInt("id", savedSearch); + createdAt = getDate("created_at", savedSearch, "EEE MMM dd HH:mm:ss z yyyy"); + query = getUnescapedString("query", savedSearch); + position = getInt("position", savedSearch); + name = getUnescapedString("name", savedSearch); + id = getInt("id", savedSearch); } public int compareTo(SavedSearch that) { diff --git a/twitter4j-core/src/main/java/twitter4j/SimilarPlaces.java b/twitter4j-core/src/main/java/twitter4j/SimilarPlaces.java index 795a990b5..b37f2da09 100644 --- a/twitter4j-core/src/main/java/twitter4j/SimilarPlaces.java +++ b/twitter4j-core/src/main/java/twitter4j/SimilarPlaces.java @@ -1,38 +1,29 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; /** * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.1.7 */ -public interface SimilarPlaces extends ResponseList{ +public interface SimilarPlaces extends ResponseList { /** * Returns the token needed to be able to create a new place with {@link twitter4j.api.GeoMethods#createPlace(String, String, String, GeoLocation, String)}. + * * @return token the token needed to be able to create a new place with {@link twitter4j.api.GeoMethods#createPlace(String, String, String, GeoLocation, String)} */ String getToken(); diff --git a/twitter4j-core/src/main/java/twitter4j/SimilarPlacesImpl.java b/twitter4j-core/src/main/java/twitter4j/SimilarPlacesImpl.java index d922f5a1a..7bdbf0ca6 100644 --- a/twitter4j-core/src/main/java/twitter4j/SimilarPlacesImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/SimilarPlacesImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import twitter4j.internal.http.HttpResponse; @@ -50,7 +40,9 @@ public class SimilarPlacesImpl extends ResponseListImpl implements Simila public String getToken() { return token; } - /*package*/ static SimilarPlaces createSimilarPlaces(HttpResponse res) throws TwitterException { + + /*package*/ + static SimilarPlaces createSimilarPlaces(HttpResponse res) throws TwitterException { JSONObject json = null; try { json = res.asJSONObject(); diff --git a/twitter4j-core/src/main/java/twitter4j/SiteStreamsAdapter.java b/twitter4j-core/src/main/java/twitter4j/SiteStreamsAdapter.java index 0ea36d625..d0d5402ec 100644 --- a/twitter4j-core/src/main/java/twitter4j/SiteStreamsAdapter.java +++ b/twitter4j-core/src/main/java/twitter4j/SiteStreamsAdapter.java @@ -1,29 +1,19 @@ package twitter4j;/* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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. + */ + /** * @author Yusuke Yamamoto - yusuke at mac.com diff --git a/twitter4j-core/src/main/java/twitter4j/SiteStreamsImpl.java b/twitter4j-core/src/main/java/twitter4j/SiteStreamsImpl.java index e0e6606b8..b6fbe8d28 100644 --- a/twitter4j-core/src/main/java/twitter4j/SiteStreamsImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/SiteStreamsImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.conf.Configuration; diff --git a/twitter4j-core/src/main/java/twitter4j/SiteStreamsListener.java b/twitter4j-core/src/main/java/twitter4j/SiteStreamsListener.java index 8d48df643..dcb220719 100644 --- a/twitter4j-core/src/main/java/twitter4j/SiteStreamsListener.java +++ b/twitter4j-core/src/main/java/twitter4j/SiteStreamsListener.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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; /** diff --git a/twitter4j-core/src/main/java/twitter4j/Status.java b/twitter4j-core/src/main/java/twitter4j/Status.java index e14e162ac..78f54a4fb 100644 --- a/twitter4j-core/src/main/java/twitter4j/Status.java +++ b/twitter4j-core/src/main/java/twitter4j/Status.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.Date; diff --git a/twitter4j-core/src/main/java/twitter4j/StatusAdapter.java b/twitter4j-core/src/main/java/twitter4j/StatusAdapter.java index 179dc66ca..0e13c8274 100644 --- a/twitter4j-core/src/main/java/twitter4j/StatusAdapter.java +++ b/twitter4j-core/src/main/java/twitter4j/StatusAdapter.java @@ -1,44 +1,38 @@ -/* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -package twitter4j; - -/** - * @author Rémy Rakic at gmail.com - * @since Twitter4J 2.1.3 - */ -public class StatusAdapter implements StatusListener { - public void onStatus(Status status) { - } - public void onDeletionNotice(StatusDeletionNotice statusDeletionNotice) { - } - public void onTrackLimitationNotice(int numberOfLimitedStatuses) { - } - public void onScrubGeo(int userId, long upToStatusId) { - } - public void onException(Exception ex) { - } -} +/* + * 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 Rémy Rakic at gmail.com + * @since Twitter4J 2.1.3 + */ +public class StatusAdapter implements StatusListener { + public void onStatus(Status status) { + } + + public void onDeletionNotice(StatusDeletionNotice statusDeletionNotice) { + } + + public void onTrackLimitationNotice(int numberOfLimitedStatuses) { + } + + public void onScrubGeo(int userId, long upToStatusId) { + } + + public void onException(Exception ex) { + } +} diff --git a/twitter4j-core/src/main/java/twitter4j/StatusDeletionNotice.java b/twitter4j-core/src/main/java/twitter4j/StatusDeletionNotice.java index b7d138079..2aa79b215 100644 --- a/twitter4j-core/src/main/java/twitter4j/StatusDeletionNotice.java +++ b/twitter4j-core/src/main/java/twitter4j/StatusDeletionNotice.java @@ -1,36 +1,26 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ 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 */ diff --git a/twitter4j-core/src/main/java/twitter4j/StatusDeletionNoticeImpl.java b/twitter4j-core/src/main/java/twitter4j/StatusDeletionNoticeImpl.java index 27029243e..a642330e8 100644 --- a/twitter4j-core/src/main/java/twitter4j/StatusDeletionNoticeImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/StatusDeletionNoticeImpl.java @@ -1,37 +1,27 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; -import twitter4j.internal.org.json.JSONException; import twitter4j.internal.org.json.JSONObject; import twitter4j.internal.util.ParseUtil; /** * 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 */ diff --git a/twitter4j-core/src/main/java/twitter4j/StatusJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/StatusJSONImpl.java index c3f1cbbb9..d984fd3ea 100644 --- a/twitter4j-core/src/main/java/twitter4j/StatusJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/StatusJSONImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpResponse; diff --git a/twitter4j-core/src/main/java/twitter4j/StatusListener.java b/twitter4j-core/src/main/java/twitter4j/StatusListener.java index dce3c5a96..68da6987a 100644 --- a/twitter4j-core/src/main/java/twitter4j/StatusListener.java +++ b/twitter4j-core/src/main/java/twitter4j/StatusListener.java @@ -1,30 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * 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; /** @@ -57,7 +46,8 @@ public interface StatusListener extends StreamListener { /** * 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 userId user id * @param upToStatusId up to status id * @since Twitter4J 2.1.9 */ diff --git a/twitter4j-core/src/main/java/twitter4j/StatusStream.java b/twitter4j-core/src/main/java/twitter4j/StatusStream.java index d8e9919b6..4229a81a2 100644 --- a/twitter4j-core/src/main/java/twitter4j/StatusStream.java +++ b/twitter4j-core/src/main/java/twitter4j/StatusStream.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import java.io.IOException; @@ -36,8 +26,9 @@ public interface StatusStream extends StreamImplementation { /** * Reads next status from this stream. + * * @param listener a StatusListener implementation - * @throws TwitterException when the end of the stream has been reached. + * @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/twitter4j-core/src/main/java/twitter4j/StatusStreamImpl.java b/twitter4j-core/src/main/java/twitter4j/StatusStreamImpl.java index d6d957662..223a6b633 100644 --- a/twitter4j-core/src/main/java/twitter4j/StatusStreamImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/StatusStreamImpl.java @@ -1,35 +1,24 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.conf.Configuration; import twitter4j.internal.async.Dispatcher; import twitter4j.internal.http.HttpResponse; -import twitter4j.internal.json.DataObjectFactoryUtil; import twitter4j.internal.org.json.JSONException; import twitter4j.internal.org.json.JSONObject; import twitter4j.internal.util.ParseUtil; diff --git a/twitter4j-core/src/main/java/twitter4j/StatusUpdate.java b/twitter4j-core/src/main/java/twitter4j/StatusUpdate.java index a802f0e3c..1d4b9f714 100644 --- a/twitter4j-core/src/main/java/twitter4j/StatusUpdate.java +++ b/twitter4j-core/src/main/java/twitter4j/StatusUpdate.java @@ -1,36 +1,26 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpParameter; + import java.util.ArrayList; import java.util.List; -import twitter4j.internal.http.HttpParameter; - /** * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.1.1 @@ -45,7 +35,7 @@ public final class StatusUpdate implements java.io.Serializable { private Annotations annotations = null; private static final long serialVersionUID = -3595502688477609916L; - public StatusUpdate(String status){ + public StatusUpdate(String status) { this.status = status; } @@ -73,6 +63,7 @@ public GeoLocation getLocation() { public void setLocation(GeoLocation location) { this.location = location; } + public StatusUpdate location(GeoLocation location) { setLocation(location); return this; @@ -98,43 +89,44 @@ public boolean isDisplayCoordinates() { public void setDisplayCoordinates(boolean displayCoordinates) { this.displayCoordinates = displayCoordinates; } + public StatusUpdate displayCoordinates(boolean displayCoordinates) { setDisplayCoordinates(displayCoordinates); return this; } - + public Annotations getAnnotations() { - return annotations; - } - - public void setAnnotations(Annotations annotations) { - this.annotations = annotations; - } - - public StatusUpdate annotations(Annotations annotations) { - setAnnotations(annotations); + return annotations; + } + + public void setAnnotations(Annotations annotations) { + this.annotations = annotations; + } + + public StatusUpdate annotations(Annotations annotations) { + setAnnotations(annotations); return this; - } - - public void addAnnotation(Annotation annotation) { - if (null == annotations) { - this.annotations = new Annotations(); - } - this.annotations.addAnnotation(annotation); - } - - public StatusUpdate annotation(Annotation annotation) { - addAnnotation(annotation); + } + + public void addAnnotation(Annotation annotation) { + if (null == annotations) { + this.annotations = new Annotations(); + } + this.annotations.addAnnotation(annotation); + } + + public StatusUpdate annotation(Annotation annotation) { + addAnnotation(annotation); return this; - } - - /*package*/ HttpParameter[] asHttpParameterArray(){ + } + + /*package*/ HttpParameter[] asHttpParameterArray() { ArrayList params = new ArrayList(); appendParameter("status", status, params); - if(-1 != inReplyToStatusId){ + if (-1 != inReplyToStatusId) { appendParameter("in_reply_to_status_id", inReplyToStatusId, params); } - if(null != location){ + if (null != location) { appendParameter("lat", location.getLatitude(), params); appendParameter("long", location.getLongitude(), params); @@ -144,7 +136,7 @@ public StatusUpdate annotation(Annotation annotation) { appendParameter("display_coordinates", "false", params); } if ((null != annotations) && (!annotations.isEmpty())) { - appendParameter("annotations", annotations.asParameterValue(), params); + appendParameter("annotations", annotations.asParameterValue(), params); } HttpParameter[] paramArray = new HttpParameter[params.size()]; return params.toArray(paramArray); @@ -163,7 +155,7 @@ private void appendParameter(String name, double value, List para private void appendParameter(String name, long value, List params) { params.add(new HttpParameter(name, String.valueOf(value))); } - + @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/twitter4j-core/src/main/java/twitter4j/StreamListener.java b/twitter4j-core/src/main/java/twitter4j/StreamListener.java index d2303c53d..a5a7d9271 100644 --- a/twitter4j-core/src/main/java/twitter4j/StreamListener.java +++ b/twitter4j-core/src/main/java/twitter4j/StreamListener.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; /** diff --git a/twitter4j-core/src/main/java/twitter4j/Trend.java b/twitter4j-core/src/main/java/twitter4j/Trend.java index 7f04ec260..78261640a 100644 --- a/twitter4j-core/src/main/java/twitter4j/Trend.java +++ b/twitter4j-core/src/main/java/twitter4j/Trend.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; diff --git a/twitter4j-core/src/main/java/twitter4j/TrendJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/TrendJSONImpl.java index e30cfb214..9dfa1892e 100644 --- a/twitter4j-core/src/main/java/twitter4j/TrendJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/TrendJSONImpl.java @@ -1,34 +1,24 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; -import twitter4j.internal.org.json.JSONException; import twitter4j.internal.org.json.JSONObject; -import static twitter4j.internal.util.ParseUtil.*; + +import static twitter4j.internal.util.ParseUtil.getRawString; /** * A data class representing Trend. diff --git a/twitter4j-core/src/main/java/twitter4j/Trends.java b/twitter4j-core/src/main/java/twitter4j/Trends.java index 9fda55d28..575f632e2 100644 --- a/twitter4j-core/src/main/java/twitter4j/Trends.java +++ b/twitter4j-core/src/main/java/twitter4j/Trends.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.Date; @@ -42,6 +32,7 @@ public interface Trends extends Comparable, java.io.Serializable { * Returns the location associated with the trends.
* This method is effective only with getLocalTrends() method.
* i.e. The return value of this method will be null with Search API Methods (getTrends(), getCurrentTrends(), getDailyTrends(), and getWeeklyTrends()).
+ * * @return location * @since Twitter4J 2.1.1 */ diff --git a/twitter4j-core/src/main/java/twitter4j/TrendsJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/TrendsJSONImpl.java index 317aa48f6..a9972f7e8 100644 --- a/twitter4j-core/src/main/java/twitter4j/TrendsJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/TrendsJSONImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpResponse; diff --git a/twitter4j-core/src/main/java/twitter4j/Tweet.java b/twitter4j-core/src/main/java/twitter4j/Tweet.java index 2b9ce6dee..3f1bf603f 100644 --- a/twitter4j-core/src/main/java/twitter4j/Tweet.java +++ b/twitter4j-core/src/main/java/twitter4j/Tweet.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.Date; @@ -118,16 +108,17 @@ public interface Tweet extends Comparable, java.io.Serializable { * Returns the textual location where this tweet was posted. This location * is useful when no GeoLocation information is available, but must be translated * to coordinates via a GeoQuery. - * + * * @return The textual location where this tweet was posted */ String getLocation(); - + /** * Returns the annotations of the tweet. * At the moment this code is written (2010-08-18), Twitter Search API does * not support annotations yet (so even annotated tweets are returned without the annotations). * This method is included here for completeness and for future use. + * * @return the annotations * @since Twitter4J 2.1.4 */ diff --git a/twitter4j-core/src/main/java/twitter4j/TweetJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/TweetJSONImpl.java index 229490005..c17b4161b 100644 --- a/twitter4j-core/src/main/java/twitter4j/TweetJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/TweetJSONImpl.java @@ -1,43 +1,33 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.org.json.JSONArray; +import twitter4j.internal.org.json.JSONException; +import twitter4j.internal.org.json.JSONObject; + +import java.util.Date; + import static twitter4j.internal.util.ParseUtil.getDate; import static twitter4j.internal.util.ParseUtil.getInt; import static twitter4j.internal.util.ParseUtil.getLong; import static twitter4j.internal.util.ParseUtil.getRawString; import static twitter4j.internal.util.ParseUtil.getUnescapedString; -import java.util.Date; - -import twitter4j.internal.org.json.JSONArray; -import twitter4j.internal.org.json.JSONException; -import twitter4j.internal.org.json.JSONObject; - /** * A data class representing a Tweet in the search response * @@ -175,12 +165,12 @@ public GeoLocation getGeoLocation() { public String getLocation() { return location; } - + /** * {@inheritDoc} */ public Annotations getAnnotations() { - return annotations; + return annotations; } @Override diff --git a/twitter4j-core/src/main/java/twitter4j/Twitter.java b/twitter4j-core/src/main/java/twitter4j/Twitter.java index b3fe5914f..7c3da44d8 100644 --- a/twitter4j-core/src/main/java/twitter4j/Twitter.java +++ b/twitter4j-core/src/main/java/twitter4j/Twitter.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.api.*; diff --git a/twitter4j-core/src/main/java/twitter4j/TwitterAdapter.java b/twitter4j-core/src/main/java/twitter4j/TwitterAdapter.java index 897108644..16acfbd6c 100644 --- a/twitter4j-core/src/main/java/twitter4j/TwitterAdapter.java +++ b/twitter4j-core/src/main/java/twitter4j/TwitterAdapter.java @@ -1,61 +1,56 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.InputStream; import java.util.List; /** * A handy adapter of TwitterListener. + * + * @author Yusuke Yamamoto - yusuke at mac.com * @see twitter4j.AsyncTwitter * @see twitter4j.TwitterListener - * @author Yusuke Yamamoto - yusuke at mac.com */ public class TwitterAdapter implements TwitterListener { public TwitterAdapter() { } + /*Search API Methods*/ - public void searched(QueryResult result){ + public void searched(QueryResult result) { } + /** * @since Twitter4J 2.0.2 */ public void gotTrends(Trends trends) { } + /** * @since Twitter4J 2.0.2 */ public void gotCurrentTrends(Trends trends) { } + /** * @since Twitter4J 2.0.2 */ public void gotDailyTrends(List trendsList) { } + /** * @since Twitter4J 2.0.2 */ @@ -63,7 +58,7 @@ public void gotWeeklyTrends(List trendsList) { } /*Timeline Methods*/ - public void gotPublicTimeline(ResponseList statuses){ + public void gotPublicTimeline(ResponseList statuses) { } /** @@ -72,25 +67,30 @@ public void gotPublicTimeline(ResponseList statuses){ public void gotHomeTimeline(ResponseList statuses) { } - public void gotFriendsTimeline(ResponseList statuses){ + public void gotFriendsTimeline(ResponseList statuses) { } - public void gotUserTimeline(ResponseList statuses){ + + public void gotUserTimeline(ResponseList statuses) { } + /** * @since Twitter4J 2.0.1 */ - public void gotMentions(ResponseList statuses){ + public void gotMentions(ResponseList statuses) { } + /** * @since Twitter4J 2.0.10 */ public void gotRetweetedByMe(ResponseList statuses) { } + /** * @since Twitter4J 2.0.10 */ public void gotRetweetedToMe(ResponseList statuses) { } + /** * @since Twitter4J 2.0.10 */ @@ -110,39 +110,47 @@ public void gotRetweetedToUser(ResponseList statuses) { } /*Status Methods*/ + /** * @since Twitter4J 2.0.1 */ - public void gotShowStatus(Status statuses){ + public void gotShowStatus(Status statuses) { } - public void updatedStatus(Status statuses){ + + public void updatedStatus(Status statuses) { } - public void destroyedStatus(Status destroyedStatus){ + + public void destroyedStatus(Status destroyedStatus) { } + /** * @since Twitter4J 2.0.10 */ - public void retweetedStatus(Status retweetedStatus){ + public void retweetedStatus(Status retweetedStatus) { } + /** * @since Twitter4J 2.1.0 */ - public void gotRetweets(ResponseList retweets){ + public void gotRetweets(ResponseList retweets) { } + /** * @since Twitter4J 2.1.3 */ public void gotRetweetedBy(ResponseList users) { } + /** * @since Twitter4J 2.1.3 */ public void gotRetweetedByIDs(IDs ids) { } + /*User Methods*/ - public void gotUserDetail(User user){ + public void gotUserDetail(User user) { } /** @@ -156,6 +164,7 @@ public void lookedupUsers(ResponseList users) { */ public void searchedUser(ResponseList userList) { } + /** * @since Twitter4J 2.1.1 */ @@ -180,230 +189,291 @@ public void gotMemberSuggestions(ResponseList users) { public void gotProfileImage(ProfileImage image) { } - public void gotFriendsStatuses(PagableResponseList users){ + public void gotFriendsStatuses(PagableResponseList users) { } - public void gotFollowersStatuses(PagableResponseList users){ + + public void gotFollowersStatuses(PagableResponseList users) { } /*List Methods*/ + /** * @since Twitter4J 2.1.0 */ - public void createdUserList(UserList userList) {} + public void createdUserList(UserList userList) { + } + /** * @since Twitter4J 2.1.0 */ - public void updatedUserList(UserList userList) {} + public void updatedUserList(UserList userList) { + } + /** * @since Twitter4J 2.1.0 */ - public void gotUserLists(PagableResponseList userLists) {} + public void gotUserLists(PagableResponseList userLists) { + } + /** * @since Twitter4J 2.1.0 */ - public void gotShowUserList(UserList userList) {} + public void gotShowUserList(UserList userList) { + } + /** * @since Twitter4J 2.1.0 */ - public void destroyedUserList(UserList userList) {} + public void destroyedUserList(UserList userList) { + } + /** * @since Twitter4J 2.1.0 */ - public void gotUserListStatuses(ResponseList statuses) {} + public void gotUserListStatuses(ResponseList statuses) { + } + /** * @since Twitter4J 2.1.0 */ - public void gotUserListMemberships(PagableResponseList userLists) {} + public void gotUserListMemberships(PagableResponseList userLists) { + } + /** * @since Twitter4J 2.1.0 */ - public void gotUserListSubscriptions(PagableResponseList userLists) {} + public void gotUserListSubscriptions(PagableResponseList userLists) { + } + /** * @since Twitter4J 2.1.9 */ - public void gotAllUserLists(ResponseList lists) {} + public void gotAllUserLists(ResponseList lists) { + } /*List Members Methods*/ + /** * @since Twitter4J 2.1.0 */ - public void gotUserListMembers(PagableResponseList users) {} + public void gotUserListMembers(PagableResponseList users) { + } + /** * @since Twitter4J 2.1.0 */ - public void addedUserListMember(UserList userList) {} + public void addedUserListMember(UserList userList) { + } /** * @since Twitter4J 2.1.7 */ - public void addedUserListMembers(UserList userList) {} + public void addedUserListMembers(UserList userList) { + } /** * @since Twitter4J 2.1.0 */ - public void deletedUserListMember(UserList userList) {} + public void deletedUserListMember(UserList userList) { + } + /** * @since Twitter4J 2.1.0 */ - public void checkedUserListMembership(User user) {} + public void checkedUserListMembership(User user) { + } /*List Subscribers Methods*/ + /** * @since Twitter4J 2.1.0 */ - public void gotUserListSubscribers(PagableResponseList users) {} + public void gotUserListSubscribers(PagableResponseList users) { + } + /** * @since Twitter4J 2.1.0 */ - public void subscribedUserList(UserList userList) {} + public void subscribedUserList(UserList userList) { + } + /** * @since Twitter4J 2.1.0 */ - public void unsubscribedUserList(UserList userList) {} + public void unsubscribedUserList(UserList userList) { + } + /** * @since Twitter4J 2.1.0 */ - public void checkedUserListSubscription(User user) {} + public void checkedUserListSubscription(User user) { + } /*Direct Message Methods*/ - public void gotDirectMessages(ResponseList messages){ + public void gotDirectMessages(ResponseList messages) { } - public void gotSentDirectMessages(ResponseList messages){ + + public void gotSentDirectMessages(ResponseList messages) { } - public void sentDirectMessage(DirectMessage message){ + + public void sentDirectMessage(DirectMessage message) { } + /** * @since Twitter4J 2.0.1 */ - public void destroyedDirectMessage(DirectMessage message){ + public void destroyedDirectMessage(DirectMessage message) { } + /** * @since Twitter4J 2.1.9 */ - public void gotDirectMessage(DirectMessage message){ + public void gotDirectMessage(DirectMessage message) { } /*Friendship Methods*/ + /** * @since Twitter4J 2.0.1 */ - public void createdFriendship(User user){ + public void createdFriendship(User user) { } + /** * @since Twitter4J 2.0.1 */ - public void destroyedFriendship(User user){ + public void destroyedFriendship(User user) { } + /** * @since Twitter4J 2.0.1 */ public void gotExistsFriendship(boolean exists) { } + /** * @since Twitter4J 2.1.0 */ public void gotShowFriendship(Relationship relationship) { } + /** * @since Twitter4J 2.1.2 */ public void gotIncomingFriendships(IDs ids) { } + /** * @since Twitter4J 2.1.2 */ public void gotOutgoingFriendships(IDs ids) { } + /** * @since Twitter4J 2.1.9 */ public void lookedUpFriendships(ResponseList friendships) { } + /** * @since Twitter4J 2.1.9 */ public void updatedFriendship(Relationship relationship) { } + /*Social Graph Methods*/ - public void gotFriendsIDs(IDs ids){ + public void gotFriendsIDs(IDs ids) { } - public void gotFollowersIDs(IDs ids){ + public void gotFollowersIDs(IDs ids) { } /*Account Methods*/ - public void verifiedCredentials(User user) { - } + public void verifiedCredentials(User user) { + } public void gotRateLimitStatus(RateLimitStatus status) { } public void updatedProfileColors(User user) { } + /** * @since Twitter4J 2.1.9 */ public void gotAccountTotals(AccountTotals totals) { } + /** * @since Twitter4J 2.1.9 */ public void gotAccountSettings(AccountSettings settings) { } + /** * @since Twitter4J 2.1.0 */ public void updatedProfileImage(User user) { } + /** * @since Twitter4J 2.1.0 */ public void updatedProfileBackgroundImage(User user) { } + /** * @since Twitter4J 2.0.2 */ - public void updatedProfile(User user){ + public void updatedProfile(User user) { } + /*Favorite Methods*/ - public void gotFavorites(ResponseList statuses){ + public void gotFavorites(ResponseList statuses) { } - public void createdFavorite(Status status){ + + public void createdFavorite(Status status) { } - public void destroyedFavorite(Status status){ + + public void destroyedFavorite(Status status) { } /*Notification Methods*/ + /** * @since Twitter4J 2.0.1 */ - public void enabledNotification(User user){ + public void enabledNotification(User user) { } + /** * @since Twitter4J 2.0.1 */ - public void disabledNotification(User user){ + public void disabledNotification(User user) { } /*Block Methods*/ + /** * @since Twitter4J 2.0.1 */ - public void createdBlock(User user){ + public void createdBlock(User user) { } + /** * @since Twitter4J 2.0.1 */ - public void destroyedBlock(User user){ + public void destroyedBlock(User user) { } + /** * @since Twitter4J 2.0.4 */ - public void gotExistsBlock(boolean blockExists){ + public void gotExistsBlock(boolean blockExists) { } /** * @since Twitter4J 2.0.4 */ - public void gotBlockingUsers(ResponseList blockingUsers){ + public void gotBlockingUsers(ResponseList blockingUsers) { } /** @@ -437,10 +507,11 @@ public void gotAvailableTrends(ResponseList locations) { * @param trends trends * @since Twitter4J 2.1.1 */ - public void gotLocationTrends(Trends trends){ + public void gotLocationTrends(Trends trends) { } /*Geo Methods*/ + /** * @since Twitter4J 2.1.7 */ @@ -453,12 +524,15 @@ public void searchedPlaces(ResponseList places) { public void gotSimilarPlaces(SimilarPlaces places) { } - public void gotNearByPlaces(ResponseList places){ + public void gotNearByPlaces(ResponseList places) { } - public void gotReverseGeoCode(ResponseList places){ + + public void gotReverseGeoCode(ResponseList places) { } + public void gotGeoDetails(Place place) { } + /** * @since Twitter4J 2.1.7 */ @@ -466,6 +540,7 @@ public void createdPlace(Place place) { } /* Legal Resources*/ + /** * @since Twitter4J 2.1.7 */ @@ -489,11 +564,11 @@ public void gotRelatedResults(RelatedResults relatedResults) { } /*Help Methods*/ - public void tested(boolean test){ + public void tested(boolean test) { } /** - * @param ex TwitterException + * @param ex TwitterException * @param method */ public void onException(TwitterException ex, TwitterMethod method) { diff --git a/twitter4j-core/src/main/java/twitter4j/TwitterBase.java b/twitter4j-core/src/main/java/twitter4j/TwitterBase.java index 3b44f884c..6ce7759c5 100644 --- a/twitter4j-core/src/main/java/twitter4j/TwitterBase.java +++ b/twitter4j-core/src/main/java/twitter4j/TwitterBase.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.conf.Configuration; @@ -34,6 +24,7 @@ /** * Base class of Twitter / AsyncTwitter / TwitterStream supports Basic Authorization. + * * @author Yusuke Yamamoto - yusuke at mac.com */ abstract class TwitterBase implements java.io.Serializable { @@ -42,21 +33,21 @@ abstract class TwitterBase implements java.io.Serializable { protected Authorization auth; private static final long serialVersionUID = -3812176145960812140L; - /*package*/ TwitterBase(Configuration conf){ + /*package*/ TwitterBase(Configuration conf) { this.conf = conf; initBasicAuthorization(conf.getUser(), conf.getPassword()); } - /*package*/ TwitterBase(Configuration conf, String userId, String password){ + /*package*/ TwitterBase(Configuration conf, String userId, String password) { this.conf = conf; initBasicAuthorization(userId, password); } - private void initBasicAuthorization(String screenName, String password){ + private void initBasicAuthorization(String screenName, String password) { if (null != screenName && null != password) { auth = new BasicAuthorization(screenName, password); } - if(null == auth){ + if (null == auth) { auth = NullAuthorization.getInstance(); } } @@ -68,6 +59,7 @@ private void initBasicAuthorization(String screenName, String password){ /** * tests if the instance is authenticated by Basic + * * @return returns true if the instance is authenticated by Basic */ public final boolean isBasicAuthEnabled() { @@ -91,9 +83,10 @@ protected final void ensureOAuthEnabled() { /** * Returns the authorization scheme for this instance.
* The returned type will be either of BasicAuthorization, OAuthAuthorization, or NullAuthorization + * * @return the authorization scheme for this instance */ - public final Authorization getAuthorization(){ + public final Authorization getAuthorization() { return auth; } @@ -111,10 +104,11 @@ public boolean equals(Object o) { /** * Returns the configuration associated with this instance + * * @return configuration associated with this instance * @since Twitter4J 2.1.8 */ - public Configuration getConfiguration(){ + public Configuration getConfiguration() { return this.conf; } diff --git a/twitter4j-core/src/main/java/twitter4j/TwitterException.java b/twitter4j-core/src/main/java/twitter4j/TwitterException.java index 7e5fbce21..9812f01b0 100644 --- a/twitter4j-core/src/main/java/twitter4j/TwitterException.java +++ b/twitter4j-core/src/main/java/twitter4j/TwitterException.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpResponse; diff --git a/twitter4j-core/src/main/java/twitter4j/TwitterFactory.java b/twitter4j-core/src/main/java/twitter4j/TwitterFactory.java index 3b88f8a82..e5cbf9cfd 100644 --- a/twitter4j-core/src/main/java/twitter4j/TwitterFactory.java +++ b/twitter4j-core/src/main/java/twitter4j/TwitterFactory.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import twitter4j.conf.Configuration; diff --git a/twitter4j-core/src/main/java/twitter4j/TwitterListener.java b/twitter4j-core/src/main/java/twitter4j/TwitterListener.java index ffa64778d..1909fb4fa 100644 --- a/twitter4j-core/src/main/java/twitter4j/TwitterListener.java +++ b/twitter4j-core/src/main/java/twitter4j/TwitterListener.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.List; @@ -31,9 +21,9 @@ /** * A listner for receiving asynchronous responses from Twitter Async APIs. * + * @author Yusuke Yamamoto - yusuke at mac.com * @see twitter4j.AsyncTwitter * @see twitter4j.TwitterAdapter - * @author Yusuke Yamamoto - yusuke at mac.com */ public interface TwitterListener { /*Search API Methods*/ @@ -75,28 +65,34 @@ public interface TwitterListener { * @since Twitter4J 2.0.1 */ void gotMentions(ResponseList statuses); + /** * @since Twitter4J 2.0.10 */ void gotRetweetedByMe(ResponseList statuses); + /** * @since Twitter4J 2.0.10 */ void gotRetweetedToMe(ResponseList statuses); + /** * @since Twitter4J 2.0.10 */ void gotRetweetsOfMe(ResponseList statuses); + /** * @since Twitter4J 2.1.9 */ void gotRetweetedByUser(ResponseList statuses); + /** * @since Twitter4J 2.1.9 */ void gotRetweetedToUser(ResponseList statuses); /*Status Methods*/ + /** * @since Twitter4J 2.0.1 */ @@ -165,78 +161,96 @@ public interface TwitterListener { void gotFollowersStatuses(PagableResponseList users); /*List Methods*/ + /** * @since Twitter4J 2.1.0 */ void createdUserList(UserList userList); + /** * @since Twitter4J 2.1.0 */ void updatedUserList(UserList userList); + /** * @since Twitter4J 2.1.0 */ void gotUserLists(PagableResponseList userLists); + /** * @since Twitter4J 2.1.0 */ void gotShowUserList(UserList userList); + /** * @since Twitter4J 2.1.0 */ void destroyedUserList(UserList userList); + /** * @since Twitter4J 2.1.0 */ void gotUserListStatuses(ResponseList statuses); + /** * @since Twitter4J 2.1.0 */ void gotUserListMemberships(PagableResponseList userLists); + /** * @since Twitter4J 2.1.0 */ void gotUserListSubscriptions(PagableResponseList userLists); + /** * @since Twitter4J 2.1.9 */ void gotAllUserLists(ResponseList lists); /*List Members Methods*/ + /** * @since Twitter4J 2.1.0 */ void gotUserListMembers(PagableResponseList users); + /** * @since Twitter4J 2.1.0 */ void addedUserListMember(UserList userList); + /** * @since Twitter4J 2.1.7 */ void addedUserListMembers(UserList userList); + /** * @since Twitter4J 2.1.0 */ void deletedUserListMember(UserList userList); + /** * @since Twitter4J 2.1.0 */ void checkedUserListMembership(User users); /*List Subscribers Methods*/ + /** * @since Twitter4J 2.1.0 */ void gotUserListSubscribers(PagableResponseList users); + /** * @since Twitter4J 2.1.0 */ void subscribedUserList(UserList userList); + /** * @since Twitter4J 2.1.0 */ void unsubscribedUserList(UserList userList); + /** * @since Twitter4J 2.1.0 */ @@ -253,12 +267,14 @@ public interface TwitterListener { * @since Twitter4J 2.1.9 */ void gotDirectMessage(DirectMessage message); + /** * @since Twitter4J 2.0.1 */ void destroyedDirectMessage(DirectMessage message); /*Friendship Methods*/ + /** * @since Twitter4J 2.0.1 */ @@ -273,6 +289,7 @@ public interface TwitterListener { * @since Twitter4J 2.0.1 */ void gotExistsFriendship(boolean exists); + /** * @since Twitter4J 2.1.0 */ @@ -312,14 +329,14 @@ public interface TwitterListener { void updatedProfileColors(User user); /** - * @since Twitter4J 2.1.9 * @param totals account totals + * @since Twitter4J 2.1.9 */ void gotAccountTotals(AccountTotals totals); /** - * @since Twitter4J 2.1.9 * @param settings account settings + * @since Twitter4J 2.1.9 */ void gotAccountSettings(AccountSettings settings); @@ -346,6 +363,7 @@ public interface TwitterListener { void destroyedFavorite(Status status); /*Notification Methods*/ + /** * @since Twitter4J 2.0.1 */ @@ -357,6 +375,7 @@ public interface TwitterListener { void disabledNotification(User user); /*Block Methods*/ + /** * @since Twitter4J 2.0.1 */ @@ -404,12 +423,18 @@ public interface TwitterListener { * @since Twitter4J 2.1.1 */ void gotLocationTrends(Trends trends); + /*Geo Methods*/ void searchedPlaces(ResponseList places); + void gotSimilarPlaces(SimilarPlaces places); + void gotNearByPlaces(ResponseList places); + void gotReverseGeoCode(ResponseList places); + void gotGeoDetails(Place place); + void createdPlace(Place place); /* Legal Resources*/ @@ -436,6 +461,7 @@ public interface TwitterListener { * @param method */ void onException(TwitterException te, TwitterMethod method); + /*Search API Methods*/ TwitterMethod SEARCH = TwitterMethod.SEARCH; @@ -558,7 +584,7 @@ public interface TwitterListener { /*Local Trends Methods*/ TwitterMethod AVAILABLE_TRENDS = TwitterMethod.AVAILABLE_TRENDS; - TwitterMethod LOCATION_TRENDS = TwitterMethod.LOCATION_TRENDS; + TwitterMethod LOCATION_TRENDS = TwitterMethod.LOCATION_TRENDS; /*Geo Methods*/ TwitterMethod SEARCH_PLACES = TwitterMethod.SEARCH_PLACES; diff --git a/twitter4j-core/src/main/java/twitter4j/TwitterMethod.java b/twitter4j-core/src/main/java/twitter4j/TwitterMethod.java index 25b44f078..65c0573c4 100644 --- a/twitter4j-core/src/main/java/twitter4j/TwitterMethod.java +++ b/twitter4j-core/src/main/java/twitter4j/TwitterMethod.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.ObjectStreamException; @@ -76,7 +66,7 @@ public String toString() { '}'; } - private static TwitterMethod getInstance(String name){ + private static TwitterMethod getInstance(String name) { return instances.get(name); } diff --git a/twitter4j-core/src/main/java/twitter4j/TwitterOAuthSupportBaseImpl.java b/twitter4j-core/src/main/java/twitter4j/TwitterOAuthSupportBaseImpl.java index 007b2dcc6..68f729020 100644 --- a/twitter4j-core/src/main/java/twitter4j/TwitterOAuthSupportBaseImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/TwitterOAuthSupportBaseImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.conf.Configuration; diff --git a/twitter4j-core/src/main/java/twitter4j/TwitterResponse.java b/twitter4j-core/src/main/java/twitter4j/TwitterResponse.java index 0a3a6d9e4..4d47d397b 100644 --- a/twitter4j-core/src/main/java/twitter4j/TwitterResponse.java +++ b/twitter4j-core/src/main/java/twitter4j/TwitterResponse.java @@ -1,39 +1,29 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; /** * Super interface of Twitter Response data interfaces which indicates that rate limit status is avaialble. * + * @author Yusuke Yamamoto - yusuke at mac.com * @see twitter4j.DirectMessage * @see twitter4j.Status * @see twitter4j.User - * @author Yusuke Yamamoto - yusuke at mac.com */ public interface TwitterResponse extends java.io.Serializable { /** diff --git a/twitter4j-core/src/main/java/twitter4j/TwitterResponseImpl.java b/twitter4j-core/src/main/java/twitter4j/TwitterResponseImpl.java index 7f1e31774..e9b7a9df0 100644 --- a/twitter4j-core/src/main/java/twitter4j/TwitterResponseImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/TwitterResponseImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpResponse; @@ -32,10 +22,10 @@ /** * Super interface of Twitter Response data interfaces which indicates that rate limit status is avaialble. * + * @author Yusuke Yamamoto - yusuke at mac.com * @see twitter4j.DirectMessage * @see twitter4j.Status * @see twitter4j.User - * @author Yusuke Yamamoto - yusuke at mac.com */ /*package*/ abstract class TwitterResponseImpl implements TwitterResponse, java.io.Serializable { diff --git a/twitter4j-core/src/main/java/twitter4j/TwitterStream.java b/twitter4j-core/src/main/java/twitter4j/TwitterStream.java index f6e4e67b8..3ac026bbc 100644 --- a/twitter4j-core/src/main/java/twitter4j/TwitterStream.java +++ b/twitter4j-core/src/main/java/twitter4j/TwitterStream.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.conf.Configuration; diff --git a/twitter4j-core/src/main/java/twitter4j/TwitterStreamFactory.java b/twitter4j-core/src/main/java/twitter4j/TwitterStreamFactory.java index 77134536d..ad6464e7c 100644 --- a/twitter4j-core/src/main/java/twitter4j/TwitterStreamFactory.java +++ b/twitter4j-core/src/main/java/twitter4j/TwitterStreamFactory.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import twitter4j.conf.Configuration; diff --git a/twitter4j-core/src/main/java/twitter4j/URLEntity.java b/twitter4j-core/src/main/java/twitter4j/URLEntity.java index 943a6d3ab..bc672d17c 100644 --- a/twitter4j-core/src/main/java/twitter4j/URLEntity.java +++ b/twitter4j-core/src/main/java/twitter4j/URLEntity.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import java.net.URL; diff --git a/twitter4j-core/src/main/java/twitter4j/URLEntityJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/URLEntityJSONImpl.java index d348056c8..7d096700d 100644 --- a/twitter4j-core/src/main/java/twitter4j/URLEntityJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/URLEntityJSONImpl.java @@ -1,38 +1,28 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -package twitter4j; + * 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. + */ -import java.net.MalformedURLException; -import java.net.URL; +package twitter4j; import twitter4j.internal.org.json.JSONArray; import twitter4j.internal.org.json.JSONException; import twitter4j.internal.org.json.JSONObject; +import java.net.MalformedURLException; +import java.net.URL; + /** * A data class representing one single URL entity. * diff --git a/twitter4j-core/src/main/java/twitter4j/User.java b/twitter4j-core/src/main/java/twitter4j/User.java index 187297ed3..d03dd5f52 100644 --- a/twitter4j-core/src/main/java/twitter4j/User.java +++ b/twitter4j-core/src/main/java/twitter4j/User.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.net.URL; diff --git a/twitter4j-core/src/main/java/twitter4j/UserJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/UserJSONImpl.java index c3e25f43d..a3ed3f524 100644 --- a/twitter4j-core/src/main/java/twitter4j/UserJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/UserJSONImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpResponse; diff --git a/twitter4j-core/src/main/java/twitter4j/UserList.java b/twitter4j-core/src/main/java/twitter4j/UserList.java index 4419eb13d..44eca65e7 100644 --- a/twitter4j-core/src/main/java/twitter4j/UserList.java +++ b/twitter4j-core/src/main/java/twitter4j/UserList.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import java.net.URI; diff --git a/twitter4j-core/src/main/java/twitter4j/UserListJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/UserListJSONImpl.java index b4099d5c2..3627d7de2 100644 --- a/twitter4j-core/src/main/java/twitter4j/UserListJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/UserListJSONImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpResponse; @@ -32,12 +22,16 @@ import twitter4j.internal.org.json.JSONException; import twitter4j.internal.org.json.JSONObject; -import static twitter4j.internal.util.ParseUtil.*; import java.net.URI; import java.net.URISyntaxException; +import static twitter4j.internal.util.ParseUtil.getBoolean; +import static twitter4j.internal.util.ParseUtil.getInt; +import static twitter4j.internal.util.ParseUtil.getRawString; + /** * A data class representing Basic list information element + * * @author Dan Checkoway - dcheckoway at gmail.com * @see REST API Documentation - Basic list information element */ @@ -61,7 +55,7 @@ DataObjectFactoryUtil.clearThreadLocalMap(); JSONObject json = res.asJSONObject(); init(json); - DataObjectFactoryUtil.registerJSONObject(this,json); + DataObjectFactoryUtil.registerJSONObject(this, json); } /*package*/ UserListJSONImpl(JSONObject json) throws TwitterException { @@ -153,7 +147,7 @@ public URI getURI() { return null; } } - + /** * {@inheritDoc} */ @@ -175,7 +169,8 @@ public User getUser() { return user; } - /*package*/ static PagableResponseList createPagableUserListList(HttpResponse res) throws TwitterException { + /*package*/ + static PagableResponseList createPagableUserListList(HttpResponse res) throws TwitterException { try { DataObjectFactoryUtil.clearThreadLocalMap(); JSONObject json = res.asJSONObject(); @@ -198,7 +193,8 @@ public User getUser() { } } - /*package*/ static ResponseList createUserListList(HttpResponse res) throws TwitterException { + /*package*/ + static ResponseList createUserListList(HttpResponse res) throws TwitterException { try { DataObjectFactoryUtil.clearThreadLocalMap(); JSONArray list = res.asJSONArray(); diff --git a/twitter4j-core/src/main/java/twitter4j/UserMentionEntity.java b/twitter4j-core/src/main/java/twitter4j/UserMentionEntity.java index 2500d9978..bc140799a 100644 --- a/twitter4j-core/src/main/java/twitter4j/UserMentionEntity.java +++ b/twitter4j-core/src/main/java/twitter4j/UserMentionEntity.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import java.io.Serializable; diff --git a/twitter4j-core/src/main/java/twitter4j/UserMentionEntityJSONImpl.java b/twitter4j-core/src/main/java/twitter4j/UserMentionEntityJSONImpl.java index b1ca532ed..bcb067da2 100644 --- a/twitter4j-core/src/main/java/twitter4j/UserMentionEntityJSONImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/UserMentionEntityJSONImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.org.json.JSONArray; @@ -33,6 +23,7 @@ /** * A data interface representing one single user mention entity. + * * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.1.9 */ diff --git a/twitter4j-core/src/main/java/twitter4j/UserStream.java b/twitter4j-core/src/main/java/twitter4j/UserStream.java index 8e4fd0abb..3917773a9 100644 --- a/twitter4j-core/src/main/java/twitter4j/UserStream.java +++ b/twitter4j-core/src/main/java/twitter4j/UserStream.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import java.io.IOException; @@ -35,8 +25,9 @@ public interface UserStream extends StreamImplementation { /** * Reads next element from this stream. + * * @param listener a UserStreamListener implementation - * @throws TwitterException when the end of the stream has been reached. + * @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/twitter4j-core/src/main/java/twitter4j/UserStreamAdapter.java b/twitter4j-core/src/main/java/twitter4j/UserStreamAdapter.java index 0982e2882..50f4a46b2 100644 --- a/twitter4j-core/src/main/java/twitter4j/UserStreamAdapter.java +++ b/twitter4j-core/src/main/java/twitter4j/UserStreamAdapter.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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; /** diff --git a/twitter4j-core/src/main/java/twitter4j/UserStreamImpl.java b/twitter4j-core/src/main/java/twitter4j/UserStreamImpl.java index 8256c2cf1..4bc1b3220 100644 --- a/twitter4j-core/src/main/java/twitter4j/UserStreamImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/UserStreamImpl.java @@ -1,35 +1,24 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.conf.Configuration; import twitter4j.internal.async.Dispatcher; import twitter4j.internal.http.HttpResponse; -import twitter4j.internal.json.DataObjectFactoryUtil; import twitter4j.internal.org.json.JSONException; import twitter4j.internal.org.json.JSONObject; diff --git a/twitter4j-core/src/main/java/twitter4j/UserStreamListener.java b/twitter4j-core/src/main/java/twitter4j/UserStreamListener.java index db87e64d7..b64db8774 100644 --- a/twitter4j-core/src/main/java/twitter4j/UserStreamListener.java +++ b/twitter4j-core/src/main/java/twitter4j/UserStreamListener.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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; /** diff --git a/twitter4j-core/src/main/java/twitter4j/Version.java b/twitter4j-core/src/main/java/twitter4j/Version.java index 9c2543521..0697d4637 100644 --- a/twitter4j-core/src/main/java/twitter4j/Version.java +++ b/twitter4j-core/src/main/java/twitter4j/Version.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; /** diff --git a/twitter4j-core/src/main/java/twitter4j/api/AccountMethods.java b/twitter4j-core/src/main/java/twitter4j/api/AccountMethods.java index 8d5f52d71..92453ccf3 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/AccountMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/AccountMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.AccountSettings; @@ -39,112 +29,117 @@ * @author Joern Huxhorn - jhuxhorn at googlemail.com */ public interface AccountMethods { - /** - * Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not. Use this method to test if supplied user credentials are valid. - *
This method calls http://api.twitter.com/1/account/verify_credentials.json - * - * @return user - * @since Twitter4J 2.0.0 - * @throws twitter4j.TwitterException when Twitter service or network is unavailable, or if supplied credential is wrong (TwitterException.getStatusCode() == 401) + /** + * Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not. Use this method to test if supplied user credentials are valid. + *
This method calls http://api.twitter.com/1/account/verify_credentials.json + * + * @return user + * @throws twitter4j.TwitterException when Twitter service or network is unavailable, or if supplied credential is wrong (TwitterException.getStatusCode() == 401) * @see GET account/verify_credentials | dev.twitter.com + * @since Twitter4J 2.0.0 */ User verifyCredentials() throws TwitterException; /** - * Returns the remaining number of API requests available to the requesting user before the API limit is reached for the current hour. Calls to rate_limit_status do not count against the rate limit. If authentication credentials are provided, the rate limit status for the authenticating user is returned. Otherwise, the rate limit status for the requester's IP address is returned.
- *
This method calls http://api.twitter.com/1/account/rate_limit_status.json - * - * @return the rate limit status - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 1.1.4 + * Returns the remaining number of API requests available to the requesting user before the API limit is reached for the current hour. Calls to rate_limit_status do not count against the rate limit. If authentication credentials are provided, the rate limit status for the authenticating user is returned. Otherwise, the rate limit status for the requester's IP address is returned.
+ *
This method calls http://api.twitter.com/1/account/rate_limit_status.json + * + * @return the rate limit status + * @throws TwitterException when Twitter service or network is unavailable * @see GET account/rate_limit_status | dev.twitter.com - */ + * @since Twitter4J 1.1.4 + */ RateLimitStatus getRateLimitStatus() throws TwitterException; /** * Sets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com. Each parameter's value must be a valid hexidecimal value, and may be either three or six characters (ex: #fff or #ffffff). - *
This method calls http://api.twitter.com/1/account/update_profile_colors.json - * @param profileBackgroundColor optional, can be null - * @param profileTextColor optional, can be null - * @param profileLinkColor optional, can be null - * @param profileSidebarFillColor optional, can be null - * @param profileSidebarBorderColor optional, can be null - * @return the updated user - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.0 + *
This method calls http://api.twitter.com/1/account/update_profile_colors.json + * + * @param profileBackgroundColor optional, can be null + * @param profileTextColor optional, can be null + * @param profileLinkColor optional, can be null + * @param profileSidebarFillColor optional, can be null + * @param profileSidebarBorderColor optional, can be null + * @return the updated user + * @throws TwitterException when Twitter service or network is unavailable * @see POST account/update_profile_colors | dev.twitter.com - */ - User updateProfileColors(String profileBackgroundColor, String profileTextColor, String profileLinkColor, String profileSidebarFillColor, String profileSidebarBorderColor) - throws TwitterException; + * @since Twitter4J 2.0.0 + */ + User updateProfileColors(String profileBackgroundColor, String profileTextColor, String profileLinkColor, String profileSidebarFillColor, String profileSidebarBorderColor) + throws TwitterException; /** * Updates the authenticating user's profile image. *
This method calls http://api.twitter.com/1/account/update_profile_image.json + * * @param image Must be a valid GIF, JPG, or PNG image of less than 700 kilobytes in size. Images with width larger than 500 pixels will be scaled down. * @return the updated user * @throws TwitterException when Twitter service or network is unavailable, - * or when the specified file is not found (FileNotFoundException will be nested), - * or when the specified file object in not representing a file (IOException will be nested) - * @since Twitter4J 2.1.0 + * or when the specified file is not found (FileNotFoundException will be nested), + * or when the specified file object in not representing a file (IOException will be nested) * @see POST account/update_profile_image | dev.twitter.com + * @since Twitter4J 2.1.0 */ User updateProfileImage(File image) throws TwitterException; /** * Updates the authenticating user's profile image. *
This method calls http://api.twitter.com/1/account/update_profile_image.json + * * @param image Must be a valid GIF, JPG, or PNG image of less than 700 kilobytes in size. Images with width larger than 500 pixels will be scaled down. * @return the updated user * @throws TwitterException when Twitter service or network is unavailable, - * or when the specified file is not found (FileNotFoundException will be nested), - * or when the specified file object in not representing a file (IOException will be nested) - * @since Twitter4J 2.1.11 + * or when the specified file is not found (FileNotFoundException will be nested), + * or when the specified file object in not representing a file (IOException will be nested) * @see POST account/update_profile_image | dev.twitter.com + * @since Twitter4J 2.1.11 */ User updateProfileImage(InputStream image) throws TwitterException; /** - * Updates the authenticating user's profile background image. - *
This method calls http://api.twitter.com/1/account/update_profile_background_image.json - * @param image Must be a valid GIF, JPG, or PNG image of less than 800 kilobytes in size. Images with width larger than 2048 pixels will be forceably scaled down. - * @param tile If set to true the background image will be displayed tiled. The image will not be tiled otherwise. - * @return the updated user - * @throws TwitterException when Twitter service or network is unavailable, - * or when the specified file is not found (FileNotFoundException will be nested), - * or when the specified file object in not representing a file (IOException will be nested) - * @since Twitter4J 2.1.0 + * Updates the authenticating user's profile background image. + *
This method calls http://api.twitter.com/1/account/update_profile_background_image.json + * + * @param image Must be a valid GIF, JPG, or PNG image of less than 800 kilobytes in size. Images with width larger than 2048 pixels will be forceably scaled down. + * @param tile If set to true the background image will be displayed tiled. The image will not be tiled otherwise. + * @return the updated user + * @throws TwitterException when Twitter service or network is unavailable, + * or when the specified file is not found (FileNotFoundException will be nested), + * or when the specified file object in not representing a file (IOException will be nested) * @see POST account/update_profile_background_image | dev.twitter.com - */ - User updateProfileBackgroundImage(File image, boolean tile) - throws TwitterException; + * @since Twitter4J 2.1.0 + */ + User updateProfileBackgroundImage(File image, boolean tile) + throws TwitterException; /** - * Updates the authenticating user's profile background image. - *
This method calls http://api.twitter.com/1/account/update_profile_background_image.json - * @param image Must be a valid GIF, JPG, or PNG image of less than 800 kilobytes in size. Images with width larger than 2048 pixels will be forceably scaled down. - * @param tile If set to true the background image will be displayed tiled. The image will not be tiled otherwise. - * @return the updated user - * @throws TwitterException when Twitter service or network is unavailable, - * or when the specified file is not found (FileNotFoundException will be nested), - * or when the specified file object in not representing a file (IOException will be nested) - * @since Twitter4J 2.1.11 + * Updates the authenticating user's profile background image. + *
This method calls http://api.twitter.com/1/account/update_profile_background_image.json + * + * @param image Must be a valid GIF, JPG, or PNG image of less than 800 kilobytes in size. Images with width larger than 2048 pixels will be forceably scaled down. + * @param tile If set to true the background image will be displayed tiled. The image will not be tiled otherwise. + * @return the updated user + * @throws TwitterException when Twitter service or network is unavailable, + * or when the specified file is not found (FileNotFoundException will be nested), + * or when the specified file object in not representing a file (IOException will be nested) * @see POST account/update_profile_background_image | dev.twitter.com - */ - User updateProfileBackgroundImage(InputStream image, boolean tile) - throws TwitterException; + * @since Twitter4J 2.1.11 + */ + User updateProfileBackgroundImage(InputStream image, boolean tile) + throws TwitterException; /** * Sets values that users are able to set under the "Account" tab of their settings page. Only the parameters specified(non-null) will be updated. *
This method calls http://api.twitter.com/1/account/update_profile.json * - * @param name Optional. Maximum of 20 characters. - * @param url Optional. Maximum of 100 characters. Will be prepended with "http://" if not present. - * @param location Optional. Maximum of 30 characters. The contents are not normalized or geocoded in any way. + * @param name Optional. Maximum of 20 characters. + * @param url Optional. Maximum of 100 characters. Will be prepended with "http://" if not present. + * @param location Optional. Maximum of 30 characters. The contents are not normalized or geocoded in any way. * @param description Optional. Maximum of 160 characters. * @return the updated user * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.1.8 * @see POST account/update_profile | dev.twitter.com + * @since Twitter4J 2.1.8 */ User updateProfile(String name, String url, String location, String description) throws TwitterException; @@ -153,6 +148,7 @@ User updateProfile(String name, String url, String location, String description) * Returns the current count of friends, followers, updates (statuses) and favorites of the authenticating user. *
This method has not been finalized and the interface is subject to change in incompatible ways. *
This method calls http://api.twitter.com/1/account/totals.json + * * @return the current count of friends, followers, updates (statuses) and favorites of the authenticating user * @throws TwitterException when Twitter service or network is unavailable * @see #newtwitter and the API - Twitter API Announcements | Google Group @@ -164,6 +160,7 @@ User updateProfile(String name, String url, String location, String description) * Returns the current trend, geo and sleep time information for the authenticating user. *
This method has not been finalized and the interface is subject to change in incompatible ways. *
This method calls http://api.twitter.com/1/account/settings.json + * * @return the current trend, geo and sleep time information for the authenticating user. * @throws TwitterException when Twitter service or network is unavailable * @see #newtwitter and the API - Twitter API Announcements | Google Group diff --git a/twitter4j-core/src/main/java/twitter4j/api/AccountMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/AccountMethodsAsync.java index 005a4c279..a429e7fe5 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/AccountMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/AccountMethodsAsync.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import java.io.File; @@ -37,67 +27,73 @@ public interface AccountMethodsAsync { * Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not. Use this method to test if supplied user credentials are valid. *
This method calls http://api.twitter.com/1/account/verify_credentials.json * - * @since Twitter4J 2.1.3 * @see GET account/verify_credentials | dev.twitter.com + * @since Twitter4J 2.1.3 */ void verifyCredentials(); - /** - * Gets the remaining number of API requests available to the requesting user before the API limit is reached for the current hour. Calls to rate_limit_status do not count against the rate limit. If authentication credentials are provided, the rate limit status for the authenticating user is returned. Otherwise, the rate limit status for the requester's IP address is returned. - *
This method calls http://api.twitter.com/1/account/rate_limit_status - * - * @since Twitter4J 1.1.4 + + /** + * Gets the remaining number of API requests available to the requesting user before the API limit is reached for the current hour. Calls to rate_limit_status do not count against the rate limit. If authentication credentials are provided, the rate limit status for the authenticating user is returned. Otherwise, the rate limit status for the requester's IP address is returned. + *
This method calls http://api.twitter.com/1/account/rate_limit_status + * * @see GET account/rate_limit_status | dev.twitter.com - */ - void getRateLimitStatus(); + * @since Twitter4J 1.1.4 + */ + void getRateLimitStatus(); - /** + /** * Sets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com. Each parameter's value must be a valid hexadecimal value, and may be either three or six characters (ex: #fff or #ffffff). - *
This method calls http://api.twitter.com/1/account/update_profile_colors - * @param profileBackgroundColor optional, can be null - * @param profileTextColor optional, can be null - * @param profileLinkColor optional, can be null - * @param profileSidebarFillColor optional, can be null - * @param profileSidebarBorderColor optional, can be null - * @since Twitter4J 2.0.0 + *
This method calls http://api.twitter.com/1/account/update_profile_colors + * + * @param profileBackgroundColor optional, can be null + * @param profileTextColor optional, can be null + * @param profileLinkColor optional, can be null + * @param profileSidebarFillColor optional, can be null + * @param profileSidebarBorderColor optional, can be null * @see POST account/update_profile_colors | dev.twitter.com - */ - void updateProfileColors(String profileBackgroundColor, String profileTextColor, String profileLinkColor, String profileSidebarFillColor, String profileSidebarBorderColor); + * @since Twitter4J 2.0.0 + */ + void updateProfileColors(String profileBackgroundColor, String profileTextColor, String profileLinkColor, String profileSidebarFillColor, String profileSidebarBorderColor); /** * Updates the authenticating user's profile image. *
This method calls http://api.twitter.com/1/account/update_profile_image.json + * * @param image Must be a valid GIF, JPG, or PNG image of less than 700 kilobytes in size. Images with width larger than 500 pixels will be scaled down. - * @since Twitter4J 2.1.0 * @see POST account/update_profile_image | dev.twitter.com + * @since Twitter4J 2.1.0 */ void updateProfileImage(File image); /** * Updates the authenticating user's profile image. *
This method calls http://api.twitter.com/1/account/update_profile_image.json + * * @param image Must be a valid GIF, JPG, or PNG image of less than 700 kilobytes in size. Images with width larger than 500 pixels will be scaled down. - * @since Twitter4J 2.1.11 * @see POST account/update_profile_image | dev.twitter.com + * @since Twitter4J 2.1.11 */ void updateProfileImage(InputStream image); /** * Updates the authenticating user's profile background image. *
This method calls http://api.twitter.com/1/account/update_profile_background_image.json + * * @param image Must be a valid GIF, JPG, or PNG image of less than 800 kilobytes in size. Images with width larger than 2048 pixels will be forcibly scaled down. - * @param tile If set to true the background image will be displayed tiled. The image will not be tiled otherwise. - * @since Twitter4J 2.1.0 + * @param tile If set to true the background image will be displayed tiled. The image will not be tiled otherwise. * @see POST account/update_profile_background_image | dev.twitter.com + * @since Twitter4J 2.1.0 */ void updateProfileBackgroundImage(File image, boolean tile); /** * Updates the authenticating user's profile background image. *
This method calls http://api.twitter.com/1/account/update_profile_background_image.json + * * @param image Must be a valid GIF, JPG, or PNG image of less than 800 kilobytes in size. Images with width larger than 2048 pixels will be forcibly scaled down. - * @param tile If set to true the background image will be displayed tiled. The image will not be tiled otherwise. - * @since Twitter4J 2.1.11 + * @param tile If set to true the background image will be displayed tiled. The image will not be tiled otherwise. * @see POST account/update_profile_background_image | dev.twitter.com + * @since Twitter4J 2.1.11 */ void updateProfileBackgroundImage(InputStream image, boolean tile); @@ -108,8 +104,8 @@ public interface AccountMethodsAsync { * @param url Optional. Maximum of 100 characters. Will be prepended with "http://" if not present. * @param location Optional. Maximum of 30 characters. The contents are not normalized or geocoded in any way. * @param description Optional. Maximum of 160 characters. - * @since Twitter4J 2.1.8 * @see POST account/update_profile | dev.twitter.com + * @since Twitter4J 2.1.8 */ void updateProfile(String name, String url, String location, String description); @@ -117,6 +113,7 @@ public interface AccountMethodsAsync { * Returns the current count of friends, followers, updates (statuses) and favorites of the authenticating user. *
This method has not been finalized and the interface is subject to change in incompatible ways. *
This method calls http://api.twitter.com/1/account/totals.json + * * @see #newtwitter and the API - Twitter API Announcements | Google Group * @since Twitter4J 2.1.9 */ @@ -126,6 +123,7 @@ public interface AccountMethodsAsync { * Returns the current trend, geo and sleep time information for the authenticating user. *
This method has not been finalized and the interface is subject to change in incompatible ways. *
This method calls http://api.twitter.com/1/account/settings.json + * * @see #newtwitter and the API - Twitter API Announcements | Google Group * @since Twitter4J 2.1.9 */ diff --git a/twitter4j-core/src/main/java/twitter4j/api/BlockMethods.java b/twitter4j-core/src/main/java/twitter4j/api/BlockMethods.java index 7dfd495c9..22a705cac 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/BlockMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/BlockMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.IDs; @@ -35,108 +25,109 @@ * @author Joern Huxhorn - jhuxhorn at googlemail.com */ public interface BlockMethods { - /** - * Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful. - *
This method calls http://api.twitter.com/1/blocks/create/[id].json - * - * @param screenName the screen_name of the user to block - * @return the blocked user - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.1 + /** + * Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful. + *
This method calls http://api.twitter.com/1/blocks/create/[id].json + * + * @param screenName the screen_name of the user to block + * @return the blocked user + * @throws TwitterException when Twitter service or network is unavailable * @see POST blocks/create | dev.twitter.com - */ - User createBlock(String screenName) throws TwitterException; + * @since Twitter4J 2.0.1 + */ + User createBlock(String screenName) throws TwitterException; - /** - * Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful. - *
This method calls http://api.twitter.com/1/blocks/create/[id].json - * - * @param userId the ID of the user to block - * @return the blocked user - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.1.0 + /** + * Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful. + *
This method calls http://api.twitter.com/1/blocks/create/[id].json + * + * @param userId the ID of the user to block + * @return the blocked user + * @throws TwitterException when Twitter service or network is unavailable * @see POST blocks/create | dev.twitter.com - */ - User createBlock(int userId) throws TwitterException; + * @since Twitter4J 2.1.0 + */ + User createBlock(int userId) throws TwitterException; - /** - * Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful. - *
This method calls http://api.twitter.com/1/blocks/destroy/[id].json - * - * @param screen_name the screen_name of the user to block - * @return the unblocked user - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.1 + /** + * Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful. + *
This method calls http://api.twitter.com/1/blocks/destroy/[id].json + * + * @param screen_name the screen_name of the user to block + * @return the unblocked user + * @throws TwitterException when Twitter service or network is unavailable * @see POST blocks/destroy | dev.twitter.com - */ - User destroyBlock(String screen_name) throws TwitterException; + * @since Twitter4J 2.0.1 + */ + User destroyBlock(String screen_name) throws TwitterException; - /** - * Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful. - *
This method calls http://api.twitter.com/1/blocks/destroy/[id].json - * - * @param userId the ID of the user to block - * @return the unblocked user - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.1 + /** + * Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful. + *
This method calls http://api.twitter.com/1/blocks/destroy/[id].json + * + * @param userId the ID of the user to block + * @return the unblocked user + * @throws TwitterException when Twitter service or network is unavailable * @see POST blocks/destroy | dev.twitter.com - */ - User destroyBlock(int userId) throws TwitterException; + * @since Twitter4J 2.0.1 + */ + User destroyBlock(int userId) throws TwitterException; - /** + /** * Returns if the authenticating user is blocking a target user. Will return the blocked user's object if a block exists, and error with a HTTP 404 response code otherwise. - *
This method calls http://api.twitter.com/1/blocks/exists/[id].json - * - * @param screenName The screen_name of the potentially blocked user. - * @return if the authenticating user is blocking a target user - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.4 + *
This method calls http://api.twitter.com/1/blocks/exists/[id].json + * + * @param screenName The screen_name of the potentially blocked user. + * @return if the authenticating user is blocking a target user + * @throws TwitterException when Twitter service or network is unavailable * @see GET blocks/exists | dev.twitter.com - */ - boolean existsBlock(String screenName) throws TwitterException; + * @since Twitter4J 2.0.4 + */ + boolean existsBlock(String screenName) throws TwitterException; - /** + /** * Returns if the authenticating user is blocking a target user. Will return the blocked user's object if a block exists, and error with a HTTP 404 response code otherwise. - *
This method calls http://api.twitter.com/1/blocks/exists/[id].json - * - * @param userId The ID of the potentially blocked user. - * @return if the authenticating user is blocking a target user - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.1.0 + *
This method calls http://api.twitter.com/1/blocks/exists/[id].json + * + * @param userId The ID of the potentially blocked user. + * @return if the authenticating user is blocking a target user + * @throws TwitterException when Twitter service or network is unavailable * @see GET blocks/exists | dev.twitter.com - */ - boolean existsBlock(int userId) throws TwitterException; + * @since Twitter4J 2.1.0 + */ + boolean existsBlock(int userId) throws TwitterException; - /** - * Returns a list of user objects that the authenticating user is blocking. - *
This method calls http://api.twitter.com/1/blocks/blocking.json - * - * @return a list of user objects that the authenticating user - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.4 + /** + * Returns a list of user objects that the authenticating user is blocking. + *
This method calls http://api.twitter.com/1/blocks/blocking.json + * + * @return a list of user objects that the authenticating user + * @throws TwitterException when Twitter service or network is unavailable * @see GET blocks/blocking | dev.twitter.com - */ - ResponseList getBlockingUsers() throws TwitterException; + * @since Twitter4J 2.0.4 + */ + ResponseList getBlockingUsers() throws TwitterException; - /** - * Returns a list of user objects that the authenticating user is blocking. - *
This method calls http://api.twitter.com/1/blocks/blocking.json - * - * @param page the number of page - * @return a list of user objects that the authenticating user - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.4 + /** + * Returns a list of user objects that the authenticating user is blocking. + *
This method calls http://api.twitter.com/1/blocks/blocking.json + * + * @param page the number of page + * @return a list of user objects that the authenticating user + * @throws TwitterException when Twitter service or network is unavailable * @see GET blocks/blocking | dev.twitter.com - */ - ResponseList getBlockingUsers(int page) throws TwitterException; + * @since Twitter4J 2.0.4 + */ + ResponseList getBlockingUsers(int page) throws TwitterException; - /** - * Returns an array of numeric user ids the authenticating user is blocking. - *
This method calls http://api.twitter.com/1/blocks/blocking/ids - * @return Returns an array of numeric user ids the authenticating user is blocking. - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.4 + /** + * Returns an array of numeric user ids the authenticating user is blocking. + *
This method calls http://api.twitter.com/1/blocks/blocking/ids + * + * @return Returns an array of numeric user ids the authenticating user is blocking. + * @throws TwitterException when Twitter service or network is unavailable * @see GET blocks/blocking/ids | dev.twitter.com - */ - IDs getBlockingUsersIDs() throws TwitterException; + * @since Twitter4J 2.0.4 + */ + IDs getBlockingUsersIDs() throws TwitterException; } diff --git a/twitter4j-core/src/main/java/twitter4j/api/BlockMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/BlockMethodsAsync.java index 475b7c4f0..0398f284b 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/BlockMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/BlockMethodsAsync.java @@ -1,119 +1,110 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; /** * @author Joern Huxhorn - jhuxhorn at googlemail.com */ public interface BlockMethodsAsync { - /** - * Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful. - *
This method calls http://api.twitter.com/1/blocks/create%C2%A0 - * - * @param screenName the screen_name of the user to block - * @since Twitter4J 2.0.1 + /** + * Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful. + *
This method calls http://api.twitter.com/1/blocks/create%C2%A0 + * + * @param screenName the screen_name of the user to block * @see POST blocks/create | dev.twitter.com - */ - void createBlock(String screenName); + * @since Twitter4J 2.0.1 + */ + void createBlock(String screenName); - /** - * Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful. - *
This method calls http://api.twitter.com/1/blocks/create%C2%A0 - * - * @param userId the screen_name of the user to block - * @since Twitter4J 2.1.0 + /** + * Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful. + *
This method calls http://api.twitter.com/1/blocks/create%C2%A0 + * + * @param userId the screen_name of the user to block * @see POST blocks/create | dev.twitter.com - */ - void createBlock(int userId); + * @since Twitter4J 2.1.0 + */ + void createBlock(int userId); - /** - * Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful. - *
This method calls http://api.twitter.com/1/blocks/create%C2%A0 - * - * @param screenName the screen_name of the user to block - * @since Twitter4J 2.0.1 + /** + * Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful. + *
This method calls http://api.twitter.com/1/blocks/create%C2%A0 + * + * @param screenName the screen_name of the user to block * @see POST blocks/destroy | dev.twitter.com - */ - void destroyBlock(String screenName); + * @since Twitter4J 2.0.1 + */ + void destroyBlock(String screenName); - /** - * Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful. - *
This method calls http://api.twitter.com/1/blocks/create%C2%A0 - * - * @param userId the ID of the user to block - * @since Twitter4J 2.1.0 + /** + * Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful. + *
This method calls http://api.twitter.com/1/blocks/create%C2%A0 + * + * @param userId the ID of the user to block * @see POST blocks/destroy | dev.twitter.com - */ - void destroyBlock(int userId); + * @since Twitter4J 2.1.0 + */ + void destroyBlock(int userId); - /** + /** * Returns if the authenticating user is blocking a target user. Will return the blocked user's object if a block exists, and error with a HTTP 404 response code otherwise. - *
This method calls http://api.twitter.com/1/blocks/exists/id.xml - * - * @param screenName The screen_name of the potentially blocked user. - * @since Twitter4J 2.0.4 + *
This method calls http://api.twitter.com/1/blocks/exists/id.xml + * + * @param screenName The screen_name of the potentially blocked user. * @see GET blocks/exists | dev.twitter.com - */ - void existsBlock(String screenName); + * @since Twitter4J 2.0.4 + */ + void existsBlock(String screenName); - /** + /** * Returns if the authenticating user is blocking a target user. Will return the blocked user's object if a block exists, and error with a HTTP 404 response code otherwise. - *
This method calls http://api.twitter.com/1/blocks/exists/id.xml - * - * @param userId The ID of the potentially blocked user. - * @since Twitter4J 2.1.0 + *
This method calls http://api.twitter.com/1/blocks/exists/id.xml + * + * @param userId The ID of the potentially blocked user. * @see GET blocks/exists | dev.twitter.com - */ - void existsBlock(int userId); + * @since Twitter4J 2.1.0 + */ + void existsBlock(int userId); - /** - * Returns a list of user objects that the authenticating user is blocking. - *
This method calls http://api.twitter.com/1/blocks/blocking.xml - * - * @since Twitter4J 2.0.4 + /** + * Returns a list of user objects that the authenticating user is blocking. + *
This method calls http://api.twitter.com/1/blocks/blocking.xml + * * @see GET blocks/blocking | dev.twitter.com - */ - void getBlockingUsers(); + * @since Twitter4J 2.0.4 + */ + void getBlockingUsers(); - /** - * Returns a list of user objects that the authenticating user is blocking. - *
This method calls http://api.twitter.com/1/blocks/blocking.xml - * - * @param page the number of page - * @since Twitter4J 2.0.4 + /** + * Returns a list of user objects that the authenticating user is blocking. + *
This method calls http://api.twitter.com/1/blocks/blocking.xml + * + * @param page the number of page * @see GET blocks/blocking | dev.twitter.com - */ - void getBlockingUsers(int page); + * @since Twitter4J 2.0.4 + */ + void getBlockingUsers(int page); - /** - * Returns an array of numeric user ids the authenticating user is blocking. - *
This method calls http://api.twitter.com/1/blocks/blocking/ids - * @since Twitter4J 2.0.4 + /** + * Returns an array of numeric user ids the authenticating user is blocking. + *
This method calls http://api.twitter.com/1/blocks/blocking/ids + * * @see GET blocks/blocking/ids | dev.twitter.com - */ - void getBlockingUsersIDs(); + * @since Twitter4J 2.0.4 + */ + void getBlockingUsersIDs(); } diff --git a/twitter4j-core/src/main/java/twitter4j/api/DirectMessageMethods.java b/twitter4j-core/src/main/java/twitter4j/api/DirectMessageMethods.java index f4dce48c4..e7b7f93a9 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/DirectMessageMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/DirectMessageMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.DirectMessage; @@ -35,94 +25,95 @@ * @author Joern Huxhorn - jhuxhorn at googlemail.com */ public interface DirectMessageMethods { - /** - * Returns a list of the direct messages sent to the authenticating user. - *
This method calls http://api.twitter.com/1/direct_messages - * - * @return List - * @throws TwitterException when Twitter service or network is unavailable + /** + * Returns a list of the direct messages sent to the authenticating user. + *
This method calls http://api.twitter.com/1/direct_messages + * + * @return List + * @throws TwitterException when Twitter service or network is unavailable * @see GET direct_messages | dev.twitter.com - */ - ResponseList getDirectMessages() - throws TwitterException; + */ + ResponseList getDirectMessages() + throws TwitterException; - /** - * Returns a list of the direct messages sent to the authenticating user. - *
This method calls http://api.twitter.com/1/direct_messages - * - * @param paging controls pagination. Supports since_id, max_id, count and page parameters. - * @return List - * @throws TwitterException when Twitter service or network is unavailable + /** + * Returns a list of the direct messages sent to the authenticating user. + *
This method calls http://api.twitter.com/1/direct_messages + * + * @param paging controls pagination. Supports since_id, max_id, count and page parameters. + * @return List + * @throws TwitterException when Twitter service or network is unavailable * @see GET direct_messages | dev.twitter.com - */ - ResponseList getDirectMessages(Paging paging) - throws TwitterException; - /** - * Returns a list of the direct messages sent by the authenticating user. - *
This method calls http://api.twitter.com/1/direct_messages/sent - * - * @return List - * @throws TwitterException when Twitter service or network is unavailable + */ + ResponseList getDirectMessages(Paging paging) + throws TwitterException; + + /** + * Returns a list of the direct messages sent by the authenticating user. + *
This method calls http://api.twitter.com/1/direct_messages/sent + * + * @return List + * @throws TwitterException when Twitter service or network is unavailable * @see GET direct_messages/sent | dev.twitter.com - */ - ResponseList getSentDirectMessages() - throws TwitterException; + */ + ResponseList getSentDirectMessages() + throws TwitterException; - /** - * Returns a list of the direct messages sent by the authenticating user. - *
This method calls http://api.twitter.com/1/direct_messages/sent - * - * @param paging controls pagination. Supports since_id, max_id, count and page parameters. - * @return List - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.1 + /** + * Returns a list of the direct messages sent by the authenticating user. + *
This method calls http://api.twitter.com/1/direct_messages/sent + * + * @param paging controls pagination. Supports since_id, max_id, count and page parameters. + * @return List + * @throws TwitterException when Twitter service or network is unavailable * @see GET direct_messages/sent | dev.twitter.com - */ - ResponseList getSentDirectMessages(Paging paging) - throws TwitterException; + * @since Twitter4J 2.0.1 + */ + ResponseList getSentDirectMessages(Paging paging) + throws TwitterException; - /** - * Sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters below. - * The text will be trimmed if the length of the text is exceeding 140 characters. - *
This method calls http://api.twitter.com/1/direct_messages/new - * - * @param screenName the screen name of the user to whom send the direct message - * @param text The text of your direct message. - * @return DirectMessage - * @throws TwitterException when Twitter service or network is unavailable + /** + * Sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters below. + * The text will be trimmed if the length of the text is exceeding 140 characters. + *
This method calls http://api.twitter.com/1/direct_messages/new + * + * @param screenName the screen name of the user to whom send the direct message + * @param text The text of your direct message. + * @return DirectMessage + * @throws TwitterException when Twitter service or network is unavailable * @see POST direct_messages/new | dev.twitter.com - */ - DirectMessage sendDirectMessage(String screenName, String text) - throws TwitterException; + */ + DirectMessage sendDirectMessage(String screenName, String text) + throws TwitterException; - /** - * Sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters below. - * The text will be trimmed if the length of the text is exceeding 140 characters. - *
This method calls http://api.twitter.com/1/direct_messages/new - * - * @param userId the screen name of the user to whom send the direct message - * @param text The text of your direct message. - * @return DirectMessage - * @throws TwitterException when Twitter service or network is unavailable + /** + * Sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters below. + * The text will be trimmed if the length of the text is exceeding 140 characters. + *
This method calls http://api.twitter.com/1/direct_messages/new + * + * @param userId the screen name of the user to whom send the direct message + * @param text The text of your direct message. + * @return DirectMessage + * @throws TwitterException when Twitter service or network is unavailable * @see POST direct_messages/new | dev.twitter.com - * @since Twitter4j 2.1.0 - */ - DirectMessage sendDirectMessage(int userId, String text) - throws TwitterException; + * @since Twitter4j 2.1.0 + */ + DirectMessage sendDirectMessage(int userId, String text) + throws TwitterException; - /** - * Destroys the direct message specified in the required ID parameter. The authenticating user must be the recipient of the specified direct message. - *
This method calls http://api.twitter.com/1/direct_messages/destroy - * - * @param id the ID of the direct message to destroy - * @return the deleted direct message - * @throws TwitterException when Twitter service or network is unavailable + /** + * Destroys the direct message specified in the required ID parameter. The authenticating user must be the recipient of the specified direct message. + *
This method calls http://api.twitter.com/1/direct_messages/destroy + * + * @param id the ID of the direct message to destroy + * @return the deleted direct message + * @throws TwitterException when Twitter service or network is unavailable * @see POST direct_messages/destroy/:id | dev.twitter.com - * @since Twitter4J 2.0.1 - */ - DirectMessage destroyDirectMessage(long id) - throws TwitterException; + * @since Twitter4J 2.0.1 + */ + DirectMessage destroyDirectMessage(long id) + throws TwitterException; /** * Returns a single direct message, specified by an id parameter. diff --git a/twitter4j-core/src/main/java/twitter4j/api/DirectMessageMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/DirectMessageMethodsAsync.java index 923d86c86..6f5d9368f 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/DirectMessageMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/DirectMessageMethodsAsync.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.Paging; @@ -33,66 +23,73 @@ */ public interface DirectMessageMethodsAsync { /** - * Returns a list of the direct messages sent to the authenticating user. - *
This method calls http://api.twitter.com/1/direct_messages + * Returns a list of the direct messages sent to the authenticating user. + *
This method calls http://api.twitter.com/1/direct_messages + * * @see GET direct_messages | dev.twitter.com - */ - void getDirectMessages(); + */ + void getDirectMessages(); - /** - * Returns a list of the direct messages sent to the authenticating user. - *
This method calls http://api.twitter.com/1/direct_messages - * @param paging controls pagination - * @since Twitter4J 2.0.1 + /** + * Returns a list of the direct messages sent to the authenticating user. + *
This method calls http://api.twitter.com/1/direct_messages + * + * @param paging controls pagination * @see GET direct_messages | dev.twitter.com - */ - void getDirectMessages(Paging paging); + * @since Twitter4J 2.0.1 + */ + void getDirectMessages(Paging paging); - /** - * Returns a list of the direct messages sent by the authenticating user. - *
This method calls http://api.twitter.com/1/direct_messages/sent + /** + * Returns a list of the direct messages sent by the authenticating user. + *
This method calls http://api.twitter.com/1/direct_messages/sent + * * @see GET direct_messages/sent | dev.twitter.com - */ - void getSentDirectMessages(); + */ + void getSentDirectMessages(); - /** - * Returns a list of the direct messages sent by the authenticating user. - *
This method calls http://api.twitter.com/1/direct_messages/sent - * @param paging controls pagination - * @since Twitter4J 2.0.1 + /** + * Returns a list of the direct messages sent by the authenticating user. + *
This method calls http://api.twitter.com/1/direct_messages/sent + * + * @param paging controls pagination * @see GET direct_messages/sent | dev.twitter.com - */ - void getSentDirectMessages(Paging paging); + * @since Twitter4J 2.0.1 + */ + void getSentDirectMessages(Paging paging); - /** - * Sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters below. - * The text will be trimed if the length of the text is exceeding 140 characters. - *
This method calls http://api.twitter.com/1/direct_messages/new - * @param screenName the screen name of the user to whom send the direct message - * @param text The text of your direct message. + /** + * Sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters below. + * The text will be trimed if the length of the text is exceeding 140 characters. + *
This method calls http://api.twitter.com/1/direct_messages/new + * + * @param screenName the screen name of the user to whom send the direct message + * @param text The text of your direct message. * @see POST direct_messages/new | dev.twitter.com - */ - void sendDirectMessage(String screenName, String text); + */ + void sendDirectMessage(String screenName, String text); - /** - * Sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters below. - * The text will be trimed if the length of the text is exceeding 140 characters. - *
This method calls http://api.twitter.com/1/direct_messages/new - * @param userId the screen name of the user to whom send the direct message - * @param text The text of your direct message. + /** + * Sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters below. + * The text will be trimed if the length of the text is exceeding 140 characters. + *
This method calls http://api.twitter.com/1/direct_messages/new + * + * @param userId the screen name of the user to whom send the direct message + * @param text The text of your direct message. * @see POST direct_messages/new | dev.twitter.com - * @since Twitter4j 2.1.0 - */ - void sendDirectMessage(int userId, String text); + * @since Twitter4j 2.1.0 + */ + void sendDirectMessage(int userId, String text); - /** + /** * Destroys the direct message specified in the required ID parameter. The authenticating user must be the recipient of the specified direct message. - *
This method calls http://api.twitter.com/1/direct_messages/destroy - * @param id int + *
This method calls http://api.twitter.com/1/direct_messages/destroy + * + * @param id int * @see POST direct_messages/destroy/:id | dev.twitter.com - * @since Twitter4J 2.0.1 - */ - void destroyDirectMessage(long id); + * @since Twitter4J 2.0.1 + */ + void destroyDirectMessage(long id); /** * Returns a single direct message, specified by an id parameter. diff --git a/twitter4j-core/src/main/java/twitter4j/api/FavoriteMethods.java b/twitter4j-core/src/main/java/twitter4j/api/FavoriteMethods.java index 8e7df8a45..5ed599a03 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/FavoriteMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/FavoriteMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.ResponseList; @@ -34,78 +24,78 @@ * @author Joern Huxhorn - jhuxhorn at googlemail.com */ public interface FavoriteMethods { - /** - * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. - *
This method calls http://api.twitter.com/1/favorites.json - * - * @return List - * @throws TwitterException when Twitter service or network is unavailable + /** + * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. + *
This method calls http://api.twitter.com/1/favorites.json + * + * @return List + * @throws TwitterException when Twitter service or network is unavailable * @see GET favorites | dev.twitter.com - * @since Twitter4J 2.0.1 - */ - ResponseList getFavorites() - throws TwitterException; + * @since Twitter4J 2.0.1 + */ + ResponseList getFavorites() + throws TwitterException; - /** - * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. - *
This method calls http://api.twitter.com/1/favorites.json - * - * @param page the number of page - * @return ResponseList - * @throws TwitterException when Twitter service or network is unavailable + /** + * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. + *
This method calls http://api.twitter.com/1/favorites.json + * + * @param page the number of page + * @return ResponseList + * @throws TwitterException when Twitter service or network is unavailable * @see GET favorites | dev.twitter.com - * @since Twitter4J 2.0.1 - */ - ResponseList getFavorites(int page) - throws TwitterException; + * @since Twitter4J 2.0.1 + */ + ResponseList getFavorites(int page) + throws TwitterException; - /** - * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. - * - * @param id the ID or screen name of the user for whom to request a list of favorite statuses - * @return ResponseList - * @throws TwitterException when Twitter service or network is unavailable + /** + * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. + * + * @param id the ID or screen name of the user for whom to request a list of favorite statuses + * @return ResponseList + * @throws TwitterException when Twitter service or network is unavailable * @see GET favorites | dev.twitter.com - * @since Twitter4J 2.0.1 - */ - ResponseList getFavorites(String id) - throws TwitterException; + * @since Twitter4J 2.0.1 + */ + ResponseList getFavorites(String id) + throws TwitterException; - /** - * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. - *
This method calls http://api.twitter.com/1/favorites/[id].json - * - * @param id the ID or screen name of the user for whom to request a list of favorite statuses - * @param page the number of page - * @return ResponseList - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.1 + /** + * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. + *
This method calls http://api.twitter.com/1/favorites/[id].json + * + * @param id the ID or screen name of the user for whom to request a list of favorite statuses + * @param page the number of page + * @return ResponseList + * @throws TwitterException when Twitter service or network is unavailable * @see GET favorites | dev.twitter.com - */ - ResponseList getFavorites(String id, int page) - throws TwitterException; + * @since Twitter4J 2.0.1 + */ + ResponseList getFavorites(String id, int page) + throws TwitterException; - /** - * Favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful. - *
This method calls http://api.twitter.com/1/favorites/create/[id].json - * - * @param id the ID of the status to favorite - * @return Status - * @throws TwitterException when Twitter service or network is unavailable + /** + * Favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful. + *
This method calls http://api.twitter.com/1/favorites/create/[id].json + * + * @param id the ID of the status to favorite + * @return Status + * @throws TwitterException when Twitter service or network is unavailable * @see POST favorites/create/:id | dev.twitter.com - */ - Status createFavorite(long id) - throws TwitterException; + */ + Status createFavorite(long id) + throws TwitterException; - /** - * Un-favorites the status specified in the ID parameter as the authenticating user. Returns the un-favorited status in the requested format when successful. - *
This method calls http://api.twitter.com/1/favorites/destroy/[id].json - * - * @param id the ID of the status to un-favorite - * @return Status - * @throws TwitterException when Twitter service or network is unavailable + /** + * Un-favorites the status specified in the ID parameter as the authenticating user. Returns the un-favorited status in the requested format when successful. + *
This method calls http://api.twitter.com/1/favorites/destroy/[id].json + * + * @param id the ID of the status to un-favorite + * @return Status + * @throws TwitterException when Twitter service or network is unavailable * @see POST favorites/destroy/:id | dev.twitter.com - */ - Status destroyFavorite(long id) - throws TwitterException; + */ + Status destroyFavorite(long id) + throws TwitterException; } diff --git a/twitter4j-core/src/main/java/twitter4j/api/FavoriteMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/FavoriteMethodsAsync.java index f840b5739..c7edb4710 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/FavoriteMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/FavoriteMethodsAsync.java @@ -1,88 +1,82 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; /** * @author Joern Huxhorn - jhuxhorn at googlemail.com */ public interface FavoriteMethodsAsync { - /** - * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. - *
This method calls http://api.twitter.com/1/favorites + /** + * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. + *
This method calls http://api.twitter.com/1/favorites + * * @see GET favorites | dev.twitter.com - * @since Twitter4J 2.0.1 - */ - void getFavorites(); + * @since Twitter4J 2.0.1 + */ + void getFavorites(); - /** - * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. - *
This method calls http://api.twitter.com/1/favorites - * @param page number of page to retrieve favorites + /** + * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. + *
This method calls http://api.twitter.com/1/favorites + * + * @param page number of page to retrieve favorites * @see GET favorites | dev.twitter.com - * @since Twitter4J 2.0.1 - */ - void getFavorites(int page); + * @since Twitter4J 2.0.1 + */ + void getFavorites(int page); - /** - * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. - *
This method calls http://api.twitter.com/1/favorites - * @param id the ID or screen name of the user for whom to request a list of favorite statuses + /** + * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. + *
This method calls http://api.twitter.com/1/favorites + * + * @param id the ID or screen name of the user for whom to request a list of favorite statuses * @see GET favorites | dev.twitter.com - * @since Twitter4J 2.0.1 - */ - void getFavorites(String id); + * @since Twitter4J 2.0.1 + */ + void getFavorites(String id); - /** - * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. - *
This method calls http://api.twitter.com/1/favorites - * @param id the ID or screen name of the user for whom to request a list of favorite statuses. - * @param page retrieves the 20 next most recent favorite statuses. + /** + * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. + *
This method calls http://api.twitter.com/1/favorites + * + * @param id the ID or screen name of the user for whom to request a list of favorite statuses. + * @param page retrieves the 20 next most recent favorite statuses. * @see GET favorites | dev.twitter.com - * @since Twitter4J 2.0.1 - */ - void getFavorites(String id,int page); + * @since Twitter4J 2.0.1 + */ + void getFavorites(String id, int page); - /** - * Favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful. - *
This method calls http://api.twitter.com/1/favorites/create%C2%A0 - * - * @param id the ID or screen name of the user for whom to request a list of favorite statuses. - * @since 1.1.2 + /** + * Favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful. + *
This method calls http://api.twitter.com/1/favorites/create%C2%A0 + * + * @param id the ID or screen name of the user for whom to request a list of favorite statuses. * @see POST favorites/create/:id | dev.twitter.com - */ - void createFavorite(long id); + * @since 1.1.2 + */ + void createFavorite(long id); - /** - * Favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful. - *
This method calls http://api.twitter.com/1/favorites/destroy - * - * @param id the ID or screen name of the user for whom to request a list of un-favorite statuses. - * @since 1.1.2 + /** + * Favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful. + *
This method calls http://api.twitter.com/1/favorites/destroy + * + * @param id the ID or screen name of the user for whom to request a list of un-favorite statuses. * @see POST favorites/destroy/:id | dev.twitter.com - */ - void destroyFavorite(long id); + * @since 1.1.2 + */ + void destroyFavorite(long id); } diff --git a/twitter4j-core/src/main/java/twitter4j/api/FriendsFollowersMethods.java b/twitter4j-core/src/main/java/twitter4j/api/FriendsFollowersMethods.java index 65e47098b..9d9962111 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/FriendsFollowersMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/FriendsFollowersMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.IDs; diff --git a/twitter4j-core/src/main/java/twitter4j/api/FriendsFollowersMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/FriendsFollowersMethodsAsync.java index f3061e829..9d292932c 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/FriendsFollowersMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/FriendsFollowersMethodsAsync.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; /** diff --git a/twitter4j-core/src/main/java/twitter4j/api/FriendshipMethods.java b/twitter4j-core/src/main/java/twitter4j/api/FriendshipMethods.java index 5df2b069a..bc0178b6d 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/FriendshipMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/FriendshipMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.api; import twitter4j.Friendship; @@ -37,132 +27,133 @@ * @author Joern Huxhorn - jhuxhorn at googlemail.com */ public interface FriendshipMethods { - /** + /** * Allows the authenticating users to follow the user specified in the ID parameter.
* Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned. - *
This method calls http://api.twitter.com/1/friendships/create/[id].json - * - * @param screenName the screen name of the user to be befriended - * @return the befriended user - * @throws twitter4j.TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.1 + *
This method calls http://api.twitter.com/1/friendships/create/[id].json + * + * @param screenName the screen name of the user to be befriended + * @return the befriended user + * @throws twitter4j.TwitterException when Twitter service or network is unavailable * @see POST friendships/create | dev.twitter.com - */ - User createFriendship(String screenName) - throws TwitterException; + * @since Twitter4J 2.0.1 + */ + User createFriendship(String screenName) + throws TwitterException; - /** + /** * Allows the authenticating users to follow the user specified in the ID parameter.
* Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned. - *
This method calls http://api.twitter.com/1/friendships/create/[id].json - * - * @param userId the ID of the user to be befriended - * @return the befriended user - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.1.0 + *
This method calls http://api.twitter.com/1/friendships/create/[id].json + * + * @param userId the ID of the user to be befriended + * @return the befriended user + * @throws TwitterException when Twitter service or network is unavailable * @see POST friendships/create | dev.twitter.com - */ - User createFriendship(int userId) - throws TwitterException; - /** + * @since Twitter4J 2.1.0 + */ + User createFriendship(int userId) + throws TwitterException; + + /** * Allows the authenticating users to follow the user specified in the ID parameter.
* Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned. - *
This method calls http://api.twitter.com/1/friendships/create/[id].json - * - * @param screenName the screen name of the user to be befriended - * @param follow Enable notifications for the target user in addition to becoming friends. - * @return the befriended user - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.2 + *
This method calls http://api.twitter.com/1/friendships/create/[id].json + * + * @param screenName the screen name of the user to be befriended + * @param follow Enable notifications for the target user in addition to becoming friends. + * @return the befriended user + * @throws TwitterException when Twitter service or network is unavailable * @see POST friendships/create | dev.twitter.com - */ - User createFriendship(String screenName, boolean follow) - throws TwitterException; + * @since Twitter4J 2.0.2 + */ + User createFriendship(String screenName, boolean follow) + throws TwitterException; - /** + /** * Allows the authenticating users to follow the user specified in the ID parameter.
* Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned. - *
This method calls http://api.twitter.com/1/friendships/create/[id].json - * - * @param userId the ID of the user to be befriended - * @param follow Enable notifications for the target user in addition to becoming friends. - * @return the befriended user - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.1.0 + *
This method calls http://api.twitter.com/1/friendships/create/[id].json + * + * @param userId the ID of the user to be befriended + * @param follow Enable notifications for the target user in addition to becoming friends. + * @return the befriended user + * @throws TwitterException when Twitter service or network is unavailable * @see POST friendships/create | dev.twitter.com - */ - User createFriendship(int userId, boolean follow) - throws TwitterException; + * @since Twitter4J 2.1.0 + */ + User createFriendship(int userId, boolean follow) + throws TwitterException; - /** + /** * Allows the authenticating users to unfollow the user specified in the ID parameter.
* Returns the unfollowed user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. - *
This method calls http://api.twitter.com/1/friendships/destroy/[id].json - * - * @param screenName the screen name of the user for whom to request a list of friends - * @return User - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.1 + *
This method calls http://api.twitter.com/1/friendships/destroy/[id].json + * + * @param screenName the screen name of the user for whom to request a list of friends + * @return User + * @throws TwitterException when Twitter service or network is unavailable * @see POST friendships/destroy | dev.twitter.com - */ - User destroyFriendship(String screenName) - throws TwitterException; + * @since Twitter4J 2.0.1 + */ + User destroyFriendship(String screenName) + throws TwitterException; - /** + /** * Allows the authenticating users to unfollow the user specified in the ID parameter.
* Returns the unfollowed user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. - *
This method calls http://api.twitter.com/1/friendships/destroy/[id].json - * - * @param userId the ID of the user for whom to request a list of friends - * @return User - * @throws TwitterException when Twitter service or network is unavailable + *
This method calls http://api.twitter.com/1/friendships/destroy/[id].json + * + * @param userId the ID of the user for whom to request a list of friends + * @return User + * @throws TwitterException when Twitter service or network is unavailable * @see POST friendships/destroy | dev.twitter.com - * @since Twitter4J 2.1.0 - */ - User destroyFriendship(int userId) - throws TwitterException; + * @since Twitter4J 2.1.0 + */ + User destroyFriendship(int userId) + throws TwitterException; - /** + /** * Tests for the existence of friendship between two users. Will return true if user_a follows user_b, otherwise will return false. - *
This method calls http://api.twitter.com/1/friendships/exists.json - * - * @param userA The ID or screen_name of the first user to test friendship for. - * @param userB The ID or screen_name of the second user to test friendship for. - * @return if a friendship exists between two users. - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.1 + *
This method calls http://api.twitter.com/1/friendships/exists.json + * + * @param userA The ID or screen_name of the first user to test friendship for. + * @param userB The ID or screen_name of the second user to test friendship for. + * @return if a friendship exists between two users. + * @throws TwitterException when Twitter service or network is unavailable * @see GET friendships/exists | dev.twitter.com - */ - boolean existsFriendship(String userA, String userB) - throws TwitterException; + * @since Twitter4J 2.0.1 + */ + boolean existsFriendship(String userA, String userB) + throws TwitterException; - /** + /** * Returns detailed information about the relationship between two users. - *
This method calls http://api.twitter.com/1/friendships/show.json - * @param sourceScreenName the screen name of the source user - * @param targetScreenName the screen name of the target user - * @return Relationship - * - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.1.0 + *
This method calls http://api.twitter.com/1/friendships/show.json + * + * @param sourceScreenName the screen name of the source user + * @param targetScreenName the screen name of the target user + * @return Relationship + * @throws TwitterException when Twitter service or network is unavailable * @see GET friendships/show | dev.twitter.com - */ - Relationship showFriendship(String sourceScreenName, String targetScreenName) - throws TwitterException; + * @since Twitter4J 2.1.0 + */ + Relationship showFriendship(String sourceScreenName, String targetScreenName) + throws TwitterException; - /** + /** * Returns detailed information about the relationship between two users. - *
This method calls http://api.twitter.com/1/friendships/show.json - * - * @param sourceId the screen ID of the source user - * @param targetId the screen ID of the target user - * @return Relationship - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.1.0 + *
This method calls http://api.twitter.com/1/friendships/show.json + * + * @param sourceId the screen ID of the source user + * @param targetId the screen ID of the target user + * @return Relationship + * @throws TwitterException when Twitter service or network is unavailable * @see GET friendships/show | dev.twitter.com - */ - Relationship showFriendship(int sourceId, int targetId) - throws TwitterException; + * @since Twitter4J 2.1.0 + */ + Relationship showFriendship(int sourceId, int targetId) + throws TwitterException; /** * Returns an array of numeric IDs for every user who has a pending request to follow the authenticating user. @@ -171,8 +162,8 @@ Relationship showFriendship(int sourceId, int targetId) * @param cursor Breaks the results into pages. A single page contains 5000 identifiers. Provide a value of -1 to begin paging. * @return an array of numeric IDs for every user who has a pending request to follow the authenticating user. * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.1.2 * @see GET friendships/incoming | dev.twitter.com + * @since Twitter4J 2.1.2 */ IDs getIncomingFriendships(long cursor) throws TwitterException; @@ -183,8 +174,8 @@ Relationship showFriendship(int sourceId, int targetId) * @param cursor Breaks the results into pages. A single page contains 5000 identifiers. Provide a value of -1 to begin paging. * @return an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request. * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.1.2 * @see GET friendships/outgoing | dev.twitter.com + * @since Twitter4J 2.1.2 */ IDs getOutgoingFriendships(long cursor) throws TwitterException; @@ -192,12 +183,12 @@ Relationship showFriendship(int sourceId, int targetId) * Returns the relationship of the authenticating user to the specified users. *
This method has not been finalized and the interface is subject to change in incompatible ways. *
This method calls http://api.twitter.com/1/friendships/lookup.json + * * @param screenNames array of the screen names to lookup * @return list of Relationships - * * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.1.9 * @see #newtwitter and the API - Twitter API Announcements | Google Group + * @since Twitter4J 2.1.9 */ ResponseList lookupFriendships(String[] screenNames) throws TwitterException; @@ -206,12 +197,12 @@ ResponseList lookupFriendships(String[] screenNames) * Returns the relationship of the authenticating user to the specified users. *
This method has not been finalized and the interface is subject to change in incompatible ways. *
This method calls http://api.twitter.com/1/friendships/lookup.json + * * @param ids array of the ids to lookup * @return list of Relationships - * * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.1.9 * @see #newtwitter and the API - Twitter API Announcements | Google Group + * @since Twitter4J 2.1.9 */ ResponseList lookupFriendships(int[] ids) throws TwitterException; @@ -220,14 +211,14 @@ ResponseList lookupFriendships(int[] ids) * Allows you to enable or disable retweets and device notifications from the specified user. *
This method has not been finalized and the interface is subject to change in incompatible ways. *
This method calls http://api.twitter.com/1/friendships/update.json - * @param screenName screen name to update + * + * @param screenName screen name to update * @param enableDeviceNotification set true to enable device notification - * @param retweets set true to enable retweets + * @param retweets set true to enable retweets * @return Relationship - * * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.1.9 * @see #newtwitter and the API - Twitter API Announcements | Google Group + * @since Twitter4J 2.1.9 */ Relationship updateFriendship(String screenName, boolean enableDeviceNotification , boolean retweets) throws TwitterException; @@ -236,14 +227,14 @@ Relationship updateFriendship(String screenName, boolean enableDeviceNotificatio * Allows you to enable or disable retweets and device notifications from the specified user. *
This method has not been finalized and the interface is subject to change in incompatible ways. *
This method calls http://api.twitter.com/1/friendships/update.json - * @param userId user id to update + * + * @param userId user id to update * @param enableDeviceNotification set true to enable device notification - * @param retweets set true to enable retweets + * @param retweets set true to enable retweets * @return Relationship - * * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.1.9 * @see #newtwitter and the API - Twitter API Announcements | Google Group + * @since Twitter4J 2.1.9 */ Relationship updateFriendship(int userId, boolean enableDeviceNotification , boolean retweets) throws TwitterException; diff --git a/twitter4j-core/src/main/java/twitter4j/api/FriendshipMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/FriendshipMethodsAsync.java index 076e29011..9bc4d5a6d 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/FriendshipMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/FriendshipMethodsAsync.java @@ -1,36 +1,21 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -package twitter4j.api; + * 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.api; -import twitter4j.Friendship; -import twitter4j.Relationship; -import twitter4j.ResponseList; -import twitter4j.TwitterException; /** * @author Joern Huxhorn - jhuxhorn at googlemail.com @@ -39,111 +24,111 @@ public interface FriendshipMethodsAsync { /** * Allows the authenticating users to follow the user specified in the ID parameter.
* Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned. - *
This method calls http://api.twitter.com/1/friendships/create - * - * @param screenName the screen name of the user to be befriended - * @since Twitter4J 2.0.1 + *
This method calls http://api.twitter.com/1/friendships/create + * + * @param screenName the screen name of the user to be befriended * @see POST friendships/create | dev.twitter.com - */ - void createFriendship(String screenName); + * @since Twitter4J 2.0.1 + */ + void createFriendship(String screenName); - /** + /** * Allows the authenticating users to follow the user specified in the ID parameter.
* Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned. - *
This method calls http://api.twitter.com/1/friendships/create - * - * @param userId the ID of the user to be befriended - * @since Twitter4J 2.1.0 + *
This method calls http://api.twitter.com/1/friendships/create + * + * @param userId the ID of the user to be befriended * @see POST friendships/create | dev.twitter.com - */ - void createFriendship(int userId); + * @since Twitter4J 2.1.0 + */ + void createFriendship(int userId); - /** + /** * Allows the authenticating users to follow the user specified in the ID parameter.
* Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned. - *
This method calls http://api.twitter.com/1/friendships/create - * - * @param screenName the screen name of the user to be befriended - * @param follow Enable notifications for the target user in addition to becoming friends. - * @since Twitter4J 2.0.1 + *
This method calls http://api.twitter.com/1/friendships/create + * + * @param screenName the screen name of the user to be befriended + * @param follow Enable notifications for the target user in addition to becoming friends. * @see POST friendships/create | dev.twitter.com - */ - void createFriendship(String screenName, boolean follow); + * @since Twitter4J 2.0.1 + */ + void createFriendship(String screenName, boolean follow); - /** + /** * Allows the authenticating users to follow the user specified in the ID parameter.
* Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned. - *
This method calls http://api.twitter.com/1/friendships/create - * - * @param userId the ID of the user to be befriended - * @param follow Enable notifications for the target user in addition to becoming friends. - * @since Twitter4J 2.1.0 + *
This method calls http://api.twitter.com/1/friendships/create + * + * @param userId the ID of the user to be befriended + * @param follow Enable notifications for the target user in addition to becoming friends. * @see POST friendships/create | dev.twitter.com - */ - void createFriendship(int userId, boolean follow); + * @since Twitter4J 2.1.0 + */ + void createFriendship(int userId, boolean follow); - /** + /** * Allows the authenticating users to unfollow the user specified in the ID parameter.
* Returns the unfollowed user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. - *
This method calls http://api.twitter.com/1/friendships/destroy - * - * @param screenName the screen name of the user to be befriended + *
This method calls http://api.twitter.com/1/friendships/destroy + * + * @param screenName the screen name of the user to be befriended * @see POST friendships/destroy | dev.twitter.com - * @since Twitter4J 2.0.1 - */ - void destroyFriendship(String screenName); + * @since Twitter4J 2.0.1 + */ + void destroyFriendship(String screenName); - /** + /** * Allows the authenticating users to unfollow the user specified in the ID parameter.
* Returns the unfollowed user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. - *
This method calls http://api.twitter.com/1/friendships/destroy - * - * @param userId the screen name of the user to be befriended + *
This method calls http://api.twitter.com/1/friendships/destroy + * + * @param userId the screen name of the user to be befriended * @see POST friendships/destroy | dev.twitter.com - * @since Twitter4J 2.1.0 - */ - void destroyFriendship(int userId); + * @since Twitter4J 2.1.0 + */ + void destroyFriendship(int userId); - /** + /** * Tests for the existence of friendship between two users. Will return true if user_a follows user_b, otherwise will return false. - *
This method calls http://api.twitter.com/1/friendships/exists - * - * @param userA The ID or screen_name of the first user to test friendship for. - * @param userB The ID or screen_name of the second user to test friendship for. - * @since Twitter4J 2.0.1 + *
This method calls http://api.twitter.com/1/friendships/exists + * + * @param userA The ID or screen_name of the first user to test friendship for. + * @param userB The ID or screen_name of the second user to test friendship for. * @see GET friendships/exists | dev.twitter.com - */ - void existsFriendship(String userA, String userB); + * @since Twitter4J 2.0.1 + */ + void existsFriendship(String userA, String userB); - /** + /** * Returns detailed information about the relationship between two users. - *
This method calls http://api.twitter.com/1/friendships/show.json - * - * @param sourceScreenName the screen name of the source user - * @param targetScreenName the screen name of the target user - * @since Twitter4J 2.1.0 + *
This method calls http://api.twitter.com/1/friendships/show.json + * + * @param sourceScreenName the screen name of the source user + * @param targetScreenName the screen name of the target user * @see GET friendships/show | dev.twitter.com - */ - void showFriendship(String sourceScreenName, String targetScreenName); + * @since Twitter4J 2.1.0 + */ + void showFriendship(String sourceScreenName, String targetScreenName); - /** + /** * Returns detailed information about the relationship between two users. - *
This method calls http://api.twitter.com/1/friendships/show.json - * - * @param sourceId the screen ID of the source user - * @param targetId the screen ID of the target user - * @since Twitter4J 2.1.0 + *
This method calls http://api.twitter.com/1/friendships/show.json + * + * @param sourceId the screen ID of the source user + * @param targetId the screen ID of the target user * @see GET friendships/show | dev.twitter.com - */ - void showFriendship(int sourceId, int targetId); + * @since Twitter4J 2.1.0 + */ + void showFriendship(int sourceId, int targetId); /** * Returns an array of numeric IDs for every user who has a pending request to follow the authenticating user. *
This method calls http://api.twitter.com/1/friendships/incoming.json * * @param cursor Breaks the results into pages. A single page contains 5000 identifiers. Provide a value of -1 to begin paging. - * @since Twitter4J 2.1.2 * @see GET friendships/incoming | dev.twitter.com + * @since Twitter4J 2.1.2 */ void getIncomingFriendships(long cursor); @@ -152,8 +137,8 @@ public interface FriendshipMethodsAsync { *
This method calls http://api.twitter.com/1/friendships/outgoing.json * * @param cursor Breaks the results into pages. A single page contains 5000 identifiers. Provide a value of -1 to begin paging. - * @since Twitter4J 2.1.2 * @see GET friendships/outgoing | dev.twitter.com + * @since Twitter4J 2.1.2 */ void getOutgoingFriendships(long cursor); @@ -161,10 +146,10 @@ public interface FriendshipMethodsAsync { * Returns the relationship of the authenticating user to the specified users. *
This method has not been finalized and the interface is subject to change in incompatible ways. *
This method calls http://api.twitter.com/1/friendships/lookup.json - * @param screenNames array of the screen names to lookup * - * @since Twitter4J 2.1.9 + * @param screenNames array of the screen names to lookup * @see #newtwitter and the API - Twitter API Announcements | Google Group + * @since Twitter4J 2.1.9 */ void lookupFriendships(String[] screenNames); @@ -172,9 +157,10 @@ public interface FriendshipMethodsAsync { * Returns the relationship of the authenticating user to the specified users. *
This method has not been finalized and the interface is subject to change in incompatible ways. *
This method calls http://api.twitter.com/1/friendships/lookup.json + * * @param ids array of the ids to lookup - * @since Twitter4J 2.1.9 * @see #newtwitter and the API - Twitter API Announcements | Google Group + * @since Twitter4J 2.1.9 */ void lookupFriendships(int[] ids); @@ -183,12 +169,12 @@ public interface FriendshipMethodsAsync { * Allows you to enable or disable retweets and device notifications from the specified user. *
This method has not been finalized and the interface is subject to change in incompatible ways. *
This method calls http://api.twitter.com/1/friendships/update.json - * @param screenName screen name to update - * @param enableDeviceNotification set true to enable device notification - * @param retweets set true to enable retweets * - * @since Twitter4J 2.1.9 + * @param screenName screen name to update + * @param enableDeviceNotification set true to enable device notification + * @param retweets set true to enable retweets * @see #newtwitter and the API - Twitter API Announcements | Google Group + * @since Twitter4J 2.1.9 */ void updateFriendship(String screenName, boolean enableDeviceNotification , boolean retweets); @@ -197,12 +183,12 @@ void updateFriendship(String screenName, boolean enableDeviceNotification * Allows you to enable or disable retweets and device notifications from the specified user. *
This method has not been finalized and the interface is subject to change in incompatible ways. *
This method calls http://api.twitter.com/1/friendships/update.json - * @param userId user id to update - * @param enableDeviceNotification set true to enable device notification - * @param retweets set true to enable retweets * - * @since Twitter4J 2.1.9 + * @param userId user id to update + * @param enableDeviceNotification set true to enable device notification + * @param retweets set true to enable retweets * @see #newtwitter and the API - Twitter API Announcements | Google Group + * @since Twitter4J 2.1.9 */ void updateFriendship(int userId, boolean enableDeviceNotification , boolean retweets); diff --git a/twitter4j-core/src/main/java/twitter4j/api/GeoMethods.java b/twitter4j-core/src/main/java/twitter4j/api/GeoMethods.java index 2cc71b636..ed1e80110 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/GeoMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/GeoMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.GeoLocation; diff --git a/twitter4j-core/src/main/java/twitter4j/api/GeoMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/GeoMethodsAsync.java index f14b632f3..2cf8cf9da 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/GeoMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/GeoMethodsAsync.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; diff --git a/twitter4j-core/src/main/java/twitter4j/api/HelpMethods.java b/twitter4j-core/src/main/java/twitter4j/api/HelpMethods.java index ba2b206fa..9547bfc89 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/HelpMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/HelpMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.TwitterException; @@ -32,13 +22,13 @@ * @author Joern Huxhorn - jhuxhorn at googlemail.com */ public interface HelpMethods { - /** - * Returns the string "ok" in the requested format with a 200 OK HTTP status code. - * - * @return true if the API is working - * @throws twitter4j.TwitterException when Twitter service or network is unavailable - * @since Twitter4J 1.0.4 + /** + * Returns the string "ok" in the requested format with a 200 OK HTTP status code. + * + * @return true if the API is working + * @throws twitter4j.TwitterException when Twitter service or network is unavailable * @see GET help/test | dev.twitter.com - */ + * @since Twitter4J 1.0.4 + */ boolean test() throws TwitterException; } diff --git a/twitter4j-core/src/main/java/twitter4j/api/HelpMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/HelpMethodsAsync.java index a62b2aa34..aed4f9ffe 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/HelpMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/HelpMethodsAsync.java @@ -1,41 +1,31 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; /** * @author Joern Huxhorn - jhuxhorn at googlemail.com */ public interface HelpMethodsAsync { - /** - * Returns the string "ok" in the requested format with a 200 OK HTTP status code. - *
This method calls http://api.twitter.com/1/help/test - * - * @since Twitter4J 2.1.0 + /** + * Returns the string "ok" in the requested format with a 200 OK HTTP status code. + *
This method calls http://api.twitter.com/1/help/test + * * @see GET help/test | dev.twitter.com - */ - void test(); + * @since Twitter4J 2.1.0 + */ + void test(); } diff --git a/twitter4j-core/src/main/java/twitter4j/api/LegalResources.java b/twitter4j-core/src/main/java/twitter4j/api/LegalResources.java index 403d08a77..cc555d12f 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/LegalResources.java +++ b/twitter4j-core/src/main/java/twitter4j/api/LegalResources.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.TwitterException; @@ -36,6 +26,7 @@ public interface LegalResources { /** * Returns Twitter's' Terms of Service. *
This method calls http://api.twitter.com/1/legal/tos.json + * * @return Terms of Service * @throws twitter4j.TwitterException when Twitter service or network is unavailable * @see GET legal/tos | dev.twitter.com @@ -46,6 +37,7 @@ public interface LegalResources { /** * Returns Twitter's Privacy Policy. *
This method calls http://api.twitter.com/1/legal/privacy.json + * * @return privacy policy * @throws twitter4j.TwitterException when Twitter service or network is unavailable * @see GET legal/privacy | dev.twitter.com diff --git a/twitter4j-core/src/main/java/twitter4j/api/LegalResourcesAsync.java b/twitter4j-core/src/main/java/twitter4j/api/LegalResourcesAsync.java index 03b54fbf7..bac9636ff 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/LegalResourcesAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/LegalResourcesAsync.java @@ -1,33 +1,21 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; -import twitter4j.TwitterException; - /** * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.1.7 @@ -36,6 +24,7 @@ public interface LegalResourcesAsync { /** * Returns Twitter's' Terms of Service. *
This method calls http://api.twitter.com/1/legal/tos.json + * * @see GET legal/tos | dev.twitter.com * @since Twitter4J 2.1.7 */ @@ -44,6 +33,7 @@ public interface LegalResourcesAsync { /** * Returns Twitter's Privacy Policy. *
This method calls http://api.twitter.com/1/legal/privacy.json + * * @see GET legal/privacy | dev.twitter.com * @since Twitter4J 2.1.7 */ diff --git a/twitter4j-core/src/main/java/twitter4j/api/ListMembersMethods.java b/twitter4j-core/src/main/java/twitter4j/api/ListMembersMethods.java index 02f8a5865..71155efa2 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/ListMembersMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/ListMembersMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.PagableResponseList; @@ -35,50 +25,54 @@ * @author Joern Huxhorn - jhuxhorn at googlemail.com */ public interface ListMembersMethods { - /** - * Returns the members of the specified list. - *
This method calls http://api.twitter.com/1/[user]/[list_id]/members.json + /** + * Returns the members of the specified list. + *
This method calls http://api.twitter.com/1/[user]/[list_id]/members.json + * * @param listOwnerScreenName The screen name of the list owner - * @param listId The id of the list - * @param cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. - * @return the members of the specified list. - * @throws TwitterException when Twitter service or network is unavailable + * @param listId The id of the list + * @param cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. + * @return the members of the specified list. + * @throws TwitterException when Twitter service or network is unavailable * @see GET :user/:list_id/members | dev.twitter.com - * @since Twitter4J 2.1.0 - */ - PagableResponseList getUserListMembers(String listOwnerScreenName, int listId, long cursor) - throws TwitterException; + * @since Twitter4J 2.1.0 + */ + PagableResponseList getUserListMembers(String listOwnerScreenName, int listId, long cursor) + throws TwitterException; /** - * Returns the members of the specified list. - *
This method calls http://api.twitter.com/1/[user]/[list_id]/members.json + * Returns the members of the specified list. + *
This method calls http://api.twitter.com/1/[user]/[list_id]/members.json + * * @param listOwnerId The id of the list owner - * @param listId The id of the list - * @param cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. - * @return the members of the specified list. - * @throws TwitterException when Twitter service or network is unavailable + * @param listId The id of the list + * @param cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. + * @return the members of the specified list. + * @throws TwitterException when Twitter service or network is unavailable * @see GET :user/:list_id/members | dev.twitter.com - * @since Twitter4J 2.1.0 - */ - PagableResponseList getUserListMembers(int listOwnerId, int listId, long cursor) - throws TwitterException; + * @since Twitter4J 2.1.0 + */ + PagableResponseList getUserListMembers(int listOwnerId, int listId, long cursor) + throws TwitterException; - /** - * Adds a member to a list. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members. - *
This method calls http://api.twitter.com/1/[listOwner]/[listId]/members.json - * @param listId The id of the list. - * @param userId The id of the user to add as a member of the list. - * @return the updated list - * @throws TwitterException when Twitter service or network is unavailable + /** + * Adds a member to a list. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members. + *
This method calls http://api.twitter.com/1/[listOwner]/[listId]/members.json + * + * @param listId The id of the list. + * @param userId The id of the user to add as a member of the list. + * @return the updated list + * @throws TwitterException when Twitter service or network is unavailable * @see POST :user/:list_id/members | dev.twitter.com - * @since Twitter4J 2.1.0 - */ + * @since Twitter4J 2.1.0 + */ UserList addUserListMember(int listId, int userId) throws TwitterException; /** * Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members, and you are limited to adding up to 100 members to a list at a time with this method. *
This method calls http://api.twitter.com/1/[user]/[list_id]/memgers/create_all.json - * @param listId The id of the list. + * + * @param listId The id of the list. * @param userIds The array of ids of the user to add as member of the list. up to 100 are allowed in a single request. * @see POST :user/:list_id/create_all | dev.twitter.com * @since Twitter4J 2.1.7 @@ -88,7 +82,8 @@ PagableResponseList getUserListMembers(int listOwnerId, int listId, long c /** * Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members, and you are limited to adding up to 100 members to a list at a time with this method. *
This method calls http://api.twitter.com/1/[user]/[list_id]/members/create_all.json - * @param listId The id of the list. + * + * @param listId The id of the list. * @param screenNames The array of screen names of the user to add as member of the list. up to 100 are allowed in a single request. * @see POST :user/:list_id/create_all | dev.twitter.com * @since Twitter4J 2.1.7 @@ -96,30 +91,32 @@ PagableResponseList getUserListMembers(int listOwnerId, int listId, long c UserList addUserListMembers(int listId, String[] screenNames) throws TwitterException; /** - * Removes the specified member from the list. The authenticated user must be the list's owner to remove members from the list. - *
This method calls http://api.twitter.com/1/[listOwner]/[listId]/members.json - * @param listId The id of the list. - * @param userId The screen name of the member you wish to remove from the list. - * @return the updated list - * @throws TwitterException when Twitter service or network is unavailable + * Removes the specified member from the list. The authenticated user must be the list's owner to remove members from the list. + *
This method calls http://api.twitter.com/1/[listOwner]/[listId]/members.json + * + * @param listId The id of the list. + * @param userId The screen name of the member you wish to remove from the list. + * @return the updated list + * @throws TwitterException when Twitter service or network is unavailable * @see DELETE :user/:id/members | dev.twitter.com - * @since Twitter4J 2.1.0 - */ + * @since Twitter4J 2.1.0 + */ UserList deleteUserListMember(int listId, int userId) throws TwitterException; /** - * Check if a user is a member of the specified list.
- *
This method calls http://api.twitter.com/1/[listOwner]/[listId]/members/id.json + * Check if a user is a member of the specified list.
+ *
This method calls http://api.twitter.com/1/[listOwner]/[listId]/members/id.json + * * @param listOwnerScreenName The screen name of the list owner - * @param listId The id of the list. - * @param userId The id of the user who you want to know is a member or not of the specified list. - * @return the updated list - * @throws TwitterException when Twitter service or network is unavailable - * , or the user is not a member of the specified list(TwitterException.getStatusCode() returns 404 in that case.) + * @param listId The id of the list. + * @param userId The id of the user who you want to know is a member or not of the specified list. + * @return the updated list + * @throws TwitterException when Twitter service or network is unavailable + * , or the user is not a member of the specified list(TwitterException.getStatusCode() returns 404 in that case.) * @see GET :user/:list_id/members/:id | dev.twitter.com - * @since Twitter4J 2.1.0 - */ - User checkUserListMembership(String listOwnerScreenName, int listId, int userId) - throws TwitterException; + * @since Twitter4J 2.1.0 + */ + User checkUserListMembership(String listOwnerScreenName, int listId, int userId) + throws TwitterException; } diff --git a/twitter4j-core/src/main/java/twitter4j/api/ListMembersMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/ListMembersMethodsAsync.java index 4b00ffaad..cdfa00519 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/ListMembersMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/ListMembersMethodsAsync.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; /** @@ -33,9 +23,10 @@ public interface ListMembersMethodsAsync { /** * Returns the members of the specified list. *
This method calls http://api.twitter.com/1/[user]/[list_id]/members.json + * * @param listOwnerScreenName The screen name of the list owner - * @param listId The id of the list - * @param cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. + * @param listId The id of the list + * @param cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. * @see GET :user/:list_id/members | dev.twitter.com * @since Twitter4J 2.1.1 */ @@ -44,9 +35,10 @@ public interface ListMembersMethodsAsync { /** * Returns the members of the specified list. *
This method calls http://api.twitter.com/1/[user]/[list_id]/members.json + * * @param listOwnerId The id of the list owner - * @param listId The id of the list - * @param cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. + * @param listId The id of the list + * @param cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. * @see GET :user/:list_id/members | dev.twitter.com * @since Twitter4J 2.1.1 */ @@ -55,6 +47,7 @@ public interface ListMembersMethodsAsync { /** * Adds a member to a list. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members. *
This method calls http://api.twitter.com/1/[listOwner]/[listId]/members.json + * * @param listId The id of the list. * @param userId The id of the user to add as a member of the list. * @see POST :user/:list_id/members | dev.twitter.com @@ -65,7 +58,8 @@ public interface ListMembersMethodsAsync { /** * Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members, and you are limited to adding up to 100 members to a list at a time with this method. *
This method calls http://api.twitter.com/1/[user]/[list_id]/members/create_all.json - * @param listId The id of the list. + * + * @param listId The id of the list. * @param userIds The array of ids of the user to add as member of the list. up to 100 are allowed in a single request. * @see POST :user/:list_id/create_all | dev.twitter.com * @since Twitter4J 2.1.7 @@ -75,7 +69,8 @@ public interface ListMembersMethodsAsync { /** * Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members, and you are limited to adding up to 100 members to a list at a time with this method. *
This method calls http://api.twitter.com/1/[user]/[list_id]/members/create_all.json - * @param listId The id of the list. + * + * @param listId The id of the list. * @param screenNames The array of screen names of the user to add as member of the list. up to 100 are allowed in a single request. * @see POST :user/:list_id/create_all | dev.twitter.com * @since Twitter4J 2.1.7 @@ -85,6 +80,7 @@ public interface ListMembersMethodsAsync { /** * Removes the specified member from the list. The authenticated user must be the list's owner to remove members from the list. *
This method calls http://api.twitter.com/1/[listOwner]/[listId]/members.json + * * @param listId The id of the list. * @param userId The screen name of the member you wish to remove from the list. * @see DELETE :user/:id/members | dev.twitter.com @@ -95,9 +91,10 @@ public interface ListMembersMethodsAsync { /** * Check if a user is a member of the specified list.
*
This method calls http://api.twitter.com/1/[listOwner]/[listId]/members/id.json + * * @param listOwnerScreenName The screen name of the list owner - * @param listId The id of the list. - * @param userId The id of the user who you want to know is a member or not of the specified list. + * @param listId The id of the list. + * @param userId The id of the user who you want to know is a member or not of the specified list. * @see GET :user/:list_id/members/:id | dev.twitter.com * @since Twitter4J 2.1.0 */ diff --git a/twitter4j-core/src/main/java/twitter4j/api/ListMethods.java b/twitter4j-core/src/main/java/twitter4j/api/ListMethods.java index a89a0d420..6e9a3983a 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/ListMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/ListMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.PagableResponseList; @@ -123,13 +113,13 @@ UserList showUserList(String listOwnerScreenName, int id) ResponseList getUserListStatuses(String listOwnerScreenName, int id, Paging paging) throws TwitterException; - /** + /** * Show tweet timeline for members of the specified list. *
http://api.twitter.com/1/user/lists/list_id/statuses.json * - * @param listOwnerId The id of the list owner - * @param id The id of the list to delete - * @param paging controls pagination. Supports since_id, max_id, count and page parameters. + * @param listOwnerId The id of the list owner + * @param id The id of the list to delete + * @param paging controls pagination. Supports since_id, max_id, count and page parameters. * @return list of statuses for members of the specified list * @throws TwitterException when Twitter service or network is unavailable * @see GET :user/lists/:id/statuses | dev.twitter.com @@ -137,12 +127,13 @@ ResponseList getUserListStatuses(String listOwnerScreenName, int id, Pag */ ResponseList getUserListStatuses(int listOwnerId, int id, Paging paging) throws TwitterException; + /** * List the lists the specified user has been added to. *
This method calls http://api.twitter.com/1/:user/lists/memberships.json * * @param listMemberScreenName The screen name of the list member - * @param cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. + * @param cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. * @return the list of lists * @throws TwitterException when Twitter service or network is unavailable * @see GET :user/lists/memberships | dev.twitter.com @@ -162,7 +153,7 @@ PagableResponseList getUserListMemberships(String listMemberScreenName * @see GET :user/lists/subscriptions | dev.twitter.com * @since Twitter4J 2.1.0 */ - PagableResponseList getUserListSubscriptions(String listOwnerScreenName, long cursor) + PagableResponseList getUserListSubscriptions(String listOwnerScreenName, long cursor) throws TwitterException; /** diff --git a/twitter4j-core/src/main/java/twitter4j/api/ListMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/ListMethodsAsync.java index 4d4f8e222..ed961bf69 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/ListMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/ListMethodsAsync.java @@ -1,35 +1,22 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.Paging; -import twitter4j.ResponseList; -import twitter4j.TwitterException; -import twitter4j.UserList; /** * @author Joern Huxhorn - jhuxhorn at googlemail.com @@ -109,8 +96,8 @@ public interface ListMethodsAsync { *
http://api.twitter.com/1/user/lists/list_id/statuses.json * * @param listOwnerId The screen name of the list owner - * @param id The id of the list to delete - * @param paging controls pagination. Supports since_id, max_id, count and page parameters. + * @param id The id of the list to delete + * @param paging controls pagination. Supports since_id, max_id, count and page parameters. * @see GET :user/lists/:id/statuses | dev.twitter.com * @since Twitter4J 2.1.1 */ @@ -121,7 +108,7 @@ public interface ListMethodsAsync { *
This method calls http://api.twitter.com/1/:user/lists/memberships.json * * @param listMemberScreenName The screen name of the list member - * @param cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. + * @param cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. * @see GET :user/lists/memberships | dev.twitter.com * @since Twitter4J 2.1.1 */ @@ -136,7 +123,7 @@ public interface ListMethodsAsync { * @see GET :user/lists/subscriptions | dev.twitter.com * @since Twitter4J 2.1.1 */ - void getUserListSubscriptions(String listOwnerScreenName, long cursor); + void getUserListSubscriptions(String listOwnerScreenName, long cursor); /** * Returns all lists the authenticating or specified user subscribes to, including their own. diff --git a/twitter4j-core/src/main/java/twitter4j/api/ListSubscribersMethods.java b/twitter4j-core/src/main/java/twitter4j/api/ListSubscribersMethods.java index cc0ec01af..28e288b2e 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/ListSubscribersMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/ListSubscribersMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.PagableResponseList; @@ -36,57 +26,61 @@ */ public interface ListSubscribersMethods { /** - * Returns the subscribers of the specified list. + * Returns the subscribers of the specified list. *
This method calls http://api.twitter.com/1/:user/:list_id/subscribers.json + * * @param listOwnerScreenName The screen name of the list owner - * @param listId The id of the list - * @param cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. - * @return the members of the specified list. - * @throws twitter4j.TwitterException when Twitter service or network is unavailable + * @param listId The id of the list + * @param cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. + * @return the members of the specified list. + * @throws twitter4j.TwitterException when Twitter service or network is unavailable * @see GET :user/:list_id/subscribers | dev.twitter.com - * @since Twitter4J 2.1.0 - */ - PagableResponseList getUserListSubscribers(String listOwnerScreenName, int listId, long cursor) - throws TwitterException; + * @since Twitter4J 2.1.0 + */ + PagableResponseList getUserListSubscribers(String listOwnerScreenName, int listId, long cursor) + throws TwitterException; - /** - * Make the authenticated user follow the specified list. + /** + * Make the authenticated user follow the specified list. *
This method calls http://api.twitter.com/1/:listOwner/:listId/subscribers.json + * * @param listOwnerScreenName The screen name of the list owner - * @param listId The id of the list. - * @return the updated list - * @throws TwitterException when Twitter service or network is unavailable + * @param listId The id of the list. + * @return the updated list + * @throws TwitterException when Twitter service or network is unavailable * @see POST :user/:list_id/subscribers | dev.twitter.com - * @since Twitter4J 2.1.0 - */ - UserList subscribeUserList(String listOwnerScreenName, int listId) - throws TwitterException; + * @since Twitter4J 2.1.0 + */ + UserList subscribeUserList(String listOwnerScreenName, int listId) + throws TwitterException; - /** - * Unsubscribes the authenticated user form the specified list. + /** + * Unsubscribes the authenticated user form the specified list. *
This method calls http://api.twitter.com/1/:listOwner/:listId/subscribers.json + * * @param listOwnerScreenName The screen name of the list owner - * @param listId The id of the list. - * @return the updated list - * @throws TwitterException when Twitter service or network is unavailable + * @param listId The id of the list. + * @return the updated list + * @throws TwitterException when Twitter service or network is unavailable * @see DELETE :user/:list_id/subscribers | dev.twitter.com - * @since Twitter4J 2.1.0 - */ - UserList unsubscribeUserList(String listOwnerScreenName, int listId) - throws TwitterException; + * @since Twitter4J 2.1.0 + */ + UserList unsubscribeUserList(String listOwnerScreenName, int listId) + throws TwitterException; - /** - * Check if the specified user is a subscriber of the specified list. + /** + * Check if the specified user is a subscriber of the specified list. *
This method calls http://api.twitter.com/1/:listOwner/:listId/subscribers/:userId.json + * * @param listOwnerScreenName The screen name of the list owner - * @param listId The id of the list. - * @param userId The id of the user who you want to know is a member or not of the specified list. - * @return the updated list - * @throws TwitterException when Twitter service or network is unavailable - * , or the user is not a member of the specified list(TwitterException.getStatusCode() returns 404 in that case.) + * @param listId The id of the list. + * @param userId The id of the user who you want to know is a member or not of the specified list. + * @return the updated list + * @throws TwitterException when Twitter service or network is unavailable + * , or the user is not a member of the specified list(TwitterException.getStatusCode() returns 404 in that case.) * @see GET :user/:list_id/subscribers/:id | dev.twitter.com - * @since Twitter4J 2.1.0 - */ - User checkUserListSubscription(String listOwnerScreenName, int listId, int userId) - throws TwitterException; + * @since Twitter4J 2.1.0 + */ + User checkUserListSubscription(String listOwnerScreenName, int listId, int userId) + throws TwitterException; } diff --git a/twitter4j-core/src/main/java/twitter4j/api/ListSubscribersMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/ListSubscribersMethodsAsync.java index 4a36b39f1..1debb180d 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/ListSubscribersMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/ListSubscribersMethodsAsync.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; @@ -34,9 +24,10 @@ public interface ListSubscribersMethodsAsync { /** * Returns the subscribers of the specified list. *
This method calls http://api.twitter.com/1/:user/:list_id/subscribers.json + * * @param listOwnerScreenName The screen name of the list owner - * @param listId The id of the list - * @param cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. + * @param listId The id of the list + * @param cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. * @see GET :user/:list_id/subscribers | dev.twitter.com * @since Twitter4J 2.1.1 */ @@ -45,8 +36,9 @@ public interface ListSubscribersMethodsAsync { /** * Make the authenticated user follow the specified list. *
This method calls http://api.twitter.com/1/:listOwner/:listId/subscribers.json + * * @param listOwnerScreenName The screen name of the list owner - * @param listId The id of the list. + * @param listId The id of the list. * @see POST :user/:list_id/subscribers | dev.twitter.com * @since Twitter4J 2.1.1 */ @@ -55,8 +47,9 @@ public interface ListSubscribersMethodsAsync { /** * Unsubscribes the authenticated user form the specified list. *
This method calls http://api.twitter.com/1/:listOwner/:listId/subscribers.json + * * @param listOwnerScreenName The screen name of the list owner - * @param listId The id of the list. + * @param listId The id of the list. * @see DELETE :user/:list_id/subscribers | dev.twitter.com * @since Twitter4J 2.1.1 */ @@ -65,10 +58,11 @@ public interface ListSubscribersMethodsAsync { /** * Check if the specified user is a subscriber of the specified list. *
This method calls http://api.twitter.com/1/:listOwner/:listId/subscribers/:userId.json + * * @param listOwnerScreenName The screen name of the list owner - * @param listId The id of the list. - * @param userId The id of the user who you want to know is a member or not of the specified list. - * , or the user is not a member of the specified list(TwitterException.getStatusCode() returns 404 in that case.) + * @param listId The id of the list. + * @param userId The id of the user who you want to know is a member or not of the specified list. + * , or the user is not a member of the specified list(TwitterException.getStatusCode() returns 404 in that case.) * @see GET :user/:list_id/subscribers/:id | dev.twitter.com * @since Twitter4J 2.1.1 */ diff --git a/twitter4j-core/src/main/java/twitter4j/api/LocalTrendsMethods.java b/twitter4j-core/src/main/java/twitter4j/api/LocalTrendsMethods.java index e8df6c5e6..8962e8061 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/LocalTrendsMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/LocalTrendsMethods.java @@ -1,70 +1,63 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.GeoLocation; +import twitter4j.Location; import twitter4j.ResponseList; import twitter4j.Trends; import twitter4j.TwitterException; -import twitter4j.Location; /** * @author Joern Huxhorn - jhuxhorn at googlemail.com */ public interface LocalTrendsMethods { /** - * Returns the locations that Twitter has trending topic information for. The response is an array of "locations" that encode the location's WOEID (a Yahoo! Where On Earth ID) and some other human-readable information such as a canonical name and country the location belongs in. - *
This method calls http://api.twitter.com/1/trends/available.json - * @return the locations - * @throws twitter4j.TwitterException when Twitter service or network is unavailable + * Returns the locations that Twitter has trending topic information for. The response is an array of "locations" that encode the location's WOEID (a Yahoo! Where On Earth ID) and some other human-readable information such as a canonical name and country the location belongs in. + *
This method calls http://api.twitter.com/1/trends/available.json + * + * @return the locations + * @throws twitter4j.TwitterException when Twitter service or network is unavailable * @see GET trends/available | dev.twitter.com - * @since Twitter4J 2.1.1 - */ + * @since Twitter4J 2.1.1 + */ ResponseList getAvailableTrends() throws TwitterException; /** - * Returns the sorted locations that Twitter has trending topic information for. The response is an array of "locations" that encode the location's WOEID (a Yahoo! Where On Earth ID) and some other human-readable information such as a canonical name and country the location belongs in. - *
This method calls http://api.twitter.com/1/trends/available.json + * Returns the sorted locations that Twitter has trending topic information for. The response is an array of "locations" that encode the location's WOEID (a Yahoo! Where On Earth ID) and some other human-readable information such as a canonical name and country the location belongs in. + *
This method calls http://api.twitter.com/1/trends/available.json + * * @param location the available trend locations will be sorted by distance 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 unavailable + * @throws twitter4j.TwitterException when Twitter service or network is unavailable * @see GET trends/available | dev.twitter.com - * @since Twitter4J 2.1.1 - */ + * @since Twitter4J 2.1.1 + */ ResponseList getAvailableTrends(GeoLocation location) throws TwitterException; /** - * Returns the top 10 trending topics for a specific location Twitter has trending topic information for. The response is an array of "trend" objects that encode the name of the trending topic, the query parameter that can be used to search for the topic on Search, and the direct URL that can be issued against Search. This information is cached for five minutes, and therefore users are discouraged from querying these endpoints faster than once every five minutes. Global trends information is also available from this API by using a WOEID of 1. + * Returns the top 10 trending topics for a specific location Twitter has trending topic information for. The response is an array of "trend" objects that encode the name of the trending topic, the query parameter that can be used to search for the topic on Search, and the direct URL that can be issued against Search. This information is cached for five minutes, and therefore users are discouraged from querying these endpoints faster than once every five minutes. Global trends information is also available from this API by using a WOEID of 1. *
This method calls http://api.twitter.com/1/trends/:woeid.json + * * @param woeid The WOEID of the location to be querying for * @return trends - * @throws twitter4j.TwitterException when Twitter service or network is unavailable + * @throws twitter4j.TwitterException when Twitter service or network is unavailable * @see GET trends/:woeid | dev.twitter.com - * @since Twitter4J 2.1.1 - */ + * @since Twitter4J 2.1.1 + */ Trends getLocationTrends(int woeid) throws TwitterException; } diff --git a/twitter4j-core/src/main/java/twitter4j/api/LocalTrendsMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/LocalTrendsMethodsAsync.java index 375032a1d..794b0d211 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/LocalTrendsMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/LocalTrendsMethodsAsync.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.GeoLocation; @@ -33,28 +23,31 @@ */ public interface LocalTrendsMethodsAsync { /** - * Retrieves the locations that Twitter has trending topic information for. The response is an array of "locations" that encode the location's WOEID (a Yahoo! Where On Earth ID) and some other human-readable information such as a canonical name and country the location belongs in. - *
This method calls http://api.twitter.com/1/trends/available.json + * Retrieves the locations that Twitter has trending topic information for. The response is an array of "locations" that encode the location's WOEID (a Yahoo! Where On Earth ID) and some other human-readable information such as a canonical name and country the location belongs in. + *
This method calls http://api.twitter.com/1/trends/available.json + * * @see GET trends/available | dev.twitter.com - * @since Twitter4J 2.1.1 - */ + * @since Twitter4J 2.1.1 + */ void getAvailableTrends(); /** - * Retrieves the sorted locations that Twitter has trending topic information for. The response is an array of "locations" that encode the location's WOEID (a Yahoo! Where On Earth ID) and some other human-readable information such as a canonical name and country the location belongs in. - *
This method calls http://api.twitter.com/1/trends/available.json + * Retrieves the sorted locations that Twitter has trending topic information for. The response is an array of "locations" that encode the location's WOEID (a Yahoo! Where On Earth ID) and some other human-readable information such as a canonical name and country the location belongs in. + *
This method calls http://api.twitter.com/1/trends/available.json + * * @param location the available trend locations will be sorted by distance to the lat and long passed in. The sort is nearest to furthest. * @see GET trends/available | dev.twitter.com - * @since Twitter4J 2.1.1 - */ + * @since Twitter4J 2.1.1 + */ void getAvailableTrends(GeoLocation location); /** - * Retrieves the top 10 trending topics for a specific location Twitter has trending topic information for. The response is an array of "trend" objects that encode the name of the trending topic, the query parameter that can be used to search for the topic on Search, and the direct URL that can be issued against Search. This information is cached for five minutes, and therefore users are discouraged from querying these endpoints faster than once every five minutes. Global trends information is also available from this API by using a WOEID of 1. + * Retrieves the top 10 trending topics for a specific location Twitter has trending topic information for. The response is an array of "trend" objects that encode the name of the trending topic, the query parameter that can be used to search for the topic on Search, and the direct URL that can be issued against Search. This information is cached for five minutes, and therefore users are discouraged from querying these endpoints faster than once every five minutes. Global trends information is also available from this API by using a WOEID of 1. *
This method calls http://api.twitter.com/1/trends/:woeid.json + * * @param woeid The WOEID of the location to be querying for * @see GET trends/:woeid | dev.twitter.com - * @since Twitter4J 2.1.1 - */ + * @since Twitter4J 2.1.1 + */ void getLocationTrends(int woeid); } diff --git a/twitter4j-core/src/main/java/twitter4j/api/NewTwitterMethods.java b/twitter4j-core/src/main/java/twitter4j/api/NewTwitterMethods.java index 7a2003927..aab2d52b8 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/NewTwitterMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/NewTwitterMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.RelatedResults; @@ -38,6 +28,7 @@ public interface NewTwitterMethods { * If available, returns an array of replies and mentions related to the specified Tweet. There is no guarantee there will be any replies or mentions in the response. This method is only available to users who have access to #newtwitter. *
This method has not been finalized and the interface is subject to change in incompatible ways. *
This method calls http://api.twitter.com/1/related_results/show/:id + * * @param statusId the numerical ID of the status you're trying to retrieve * @return the related results of a given tweet * @throws TwitterException when Twitter service or network is unavailable diff --git a/twitter4j-core/src/main/java/twitter4j/api/NewTwitterMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/NewTwitterMethodsAsync.java index ed868612e..06e2bd466 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/NewTwitterMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/NewTwitterMethodsAsync.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.TwitterException; @@ -36,6 +26,7 @@ public interface NewTwitterMethodsAsync { /** * If available, returns an array of replies and mentions related to the specified Tweet. There is no guarantee there will be any replies or mentions in the response. This method is only available to users who have access to #newtwitter. *
This method calls http://api.twitter.com/1/related_results/show/:id + * * @param statusId the numerical ID of the status you're trying to retrieve * @throws TwitterException when Twitter service or network is unavailable * @see #newtwitter and the API - Twitter API Announcements | Google Group diff --git a/twitter4j-core/src/main/java/twitter4j/api/NotificationMethods.java b/twitter4j-core/src/main/java/twitter4j/api/NotificationMethods.java index 89fa8dd4e..33e4e9261 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/NotificationMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/NotificationMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.TwitterException; @@ -33,55 +23,55 @@ * @author Joern Huxhorn - jhuxhorn at googlemail.com */ public interface NotificationMethods { - /** - * Enables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. - *
This method calls http://api.twitter.com/1/notifications/follow.json - * - * @param screenName Specifies the screen name of the user to follow with device updates. - * @return User - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.1 + /** + * Enables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. + *
This method calls http://api.twitter.com/1/notifications/follow.json + * + * @param screenName Specifies the screen name of the user to follow with device updates. + * @return User + * @throws TwitterException when Twitter service or network is unavailable * @see POST notifications/follow | dev.twitter.com - */ - User enableNotification(String screenName) - throws TwitterException; + * @since Twitter4J 2.0.1 + */ + User enableNotification(String screenName) + throws TwitterException; - /** - * Enables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. + /** + * Enables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. *
This method calls http://api.twitter.com/1/notifications/follow.json - * - * @param userId Specifies the ID of the user to follow with device updates. - * @return User - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.1.0 + * + * @param userId Specifies the ID of the user to follow with device updates. + * @return User + * @throws TwitterException when Twitter service or network is unavailable * @see POST notifications/follow | dev.twitter.com - */ - User enableNotification(int userId) - throws TwitterException; + * @since Twitter4J 2.1.0 + */ + User enableNotification(int userId) + throws TwitterException; - /** - * Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. - *
This method calls http://api.twitter.com/1/notifications/leave.json - * - * @param screenName Specifies the screen name of the user to disable device notifications. - * @return User - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.1 + /** + * Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. + *
This method calls http://api.twitter.com/1/notifications/leave.json + * + * @param screenName Specifies the screen name of the user to disable device notifications. + * @return User + * @throws TwitterException when Twitter service or network is unavailable * @see POST notifications/leave | dev.twitter.com - */ - User disableNotification(String screenName) - throws TwitterException; + * @since Twitter4J 2.0.1 + */ + User disableNotification(String screenName) + throws TwitterException; - /** - * Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. + /** + * Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. *
This method calls http://api.twitter.com/1/notifications/leave.json - * - * @param userId Specifies the ID of the user to disable device notifications. - * @return User - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.1.0 + * + * @param userId Specifies the ID of the user to disable device notifications. + * @return User + * @throws TwitterException when Twitter service or network is unavailable * @see POST notifications/leave | dev.twitter.com - */ - User disableNotification(int userId) - throws TwitterException; + * @since Twitter4J 2.1.0 + */ + User disableNotification(int userId) + throws TwitterException; } diff --git a/twitter4j-core/src/main/java/twitter4j/api/NotificationMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/NotificationMethodsAsync.java index a2960cd32..3ae2dc88e 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/NotificationMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/NotificationMethodsAsync.java @@ -1,72 +1,62 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; /** * @author Joern Huxhorn - jhuxhorn at googlemail.com */ public interface NotificationMethodsAsync { - /** - * Enables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. + /** + * Enables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. *
This method calls http://api.twitter.com/1/notifications/follow.json - * - * @param screenName Specifies the screen name of the user to follow with device updates. - * @since Twitter4J 2.0.1 + * + * @param screenName Specifies the screen name of the user to follow with device updates. * @see POST notifications/follow | dev.twitter.com - */ - void enableNotification(String screenName); + * @since Twitter4J 2.0.1 + */ + void enableNotification(String screenName); - /** - * Enables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. + /** + * Enables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. *
This method calls http://api.twitter.com/1/notifications/follow.json - * - * @param userId Specifies the ID of the user to follow with device updates. - * @since Twitter4J 2.1.0 + * + * @param userId Specifies the ID of the user to follow with device updates. * @see POST notifications/follow | dev.twitter.com - */ - void enableNotification(int userId); + * @since Twitter4J 2.1.0 + */ + void enableNotification(int userId); - /** - * Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. + /** + * Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. *
This method calls http://api.twitter.com/1/notifications/leave.json - * - * @param screenName Specifies the screen name of the user to disable device notifications. - * @since Twitter4J 2.0.1 + * + * @param screenName Specifies the screen name of the user to disable device notifications. * @see POST notifications/leave | dev.twitter.com - */ - void disableNotification(String screenName); + * @since Twitter4J 2.0.1 + */ + void disableNotification(String screenName); - /** - * Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. + /** + * Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful. *
This method calls http://api.twitter.com/1/notifications/leave.json - * - * @param userId Specifies the ID of the user to disable device notifications. - * @since Twitter4J 2.1.0 + * + * @param userId Specifies the ID of the user to disable device notifications. * @see POST notifications/leave | dev.twitter.com - */ - void disableNotification(int userId); + * @since Twitter4J 2.1.0 + */ + void disableNotification(int userId); } diff --git a/twitter4j-core/src/main/java/twitter4j/api/SavedSearchesMethods.java b/twitter4j-core/src/main/java/twitter4j/api/SavedSearchesMethods.java index 8ddb592d0..47db7a84c 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/SavedSearchesMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/SavedSearchesMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.SavedSearch; @@ -34,50 +24,53 @@ /** * @author Joern Huxhorn - jhuxhorn at googlemail.com */ -public interface SavedSearchesMethods -{ - /** - * Returns the authenticated user's saved search queries. - *
This method calls http://api.twitter.com/1/saved_searches.json - * @return Returns an array of numeric user ids the authenticating user is blocking. - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.8 +public interface SavedSearchesMethods { + /** + * Returns the authenticated user's saved search queries. + *
This method calls http://api.twitter.com/1/saved_searches.json + * + * @return Returns an array of numeric user ids the authenticating user is blocking. + * @throws TwitterException when Twitter service or network is unavailable * @see GET saved_searches | dev.twitter.com - */ + * @since Twitter4J 2.0.8 + */ List getSavedSearches() throws TwitterException; /** - * Retrieve the data for a saved search owned by the authenticating user specified by the given id. - *
This method calls http://api.twitter.com/1/saved_searches/show/:id.json - * @param id The id of the saved search to be retrieved. - * @return the data for a saved search - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.8 + * Retrieve the data for a saved search owned by the authenticating user specified by the given id. + *
This method calls http://api.twitter.com/1/saved_searches/show/:id.json + * + * @param id The id of the saved search to be retrieved. + * @return the data for a saved search + * @throws TwitterException when Twitter service or network is unavailable * @see GET saved_searches/show/:id | dev.twitter.com - */ + * @since Twitter4J 2.0.8 + */ SavedSearch showSavedSearch(int id) throws TwitterException; /** * Creates a saved search for the authenticated user. - *
This method calls http://api.twitter.com/1/saved_searches/saved_searches/create.json - * @param query the query string - * @return the data for a created saved search - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.8 + *
This method calls http://api.twitter.com/1/saved_searches/saved_searches/create.json + * + * @param query the query string + * @return the data for a created saved search + * @throws TwitterException when Twitter service or network is unavailable * @see POST saved_searches/create | dev.twitter.com - */ - SavedSearch createSavedSearch(String query) - throws TwitterException; + * @since Twitter4J 2.0.8 + */ + SavedSearch createSavedSearch(String query) + throws TwitterException; - /** - * Destroys a saved search for the authenticated user. The search specified by id must be owned by the authenticating user. - *
This method calls http://api.twitter.com/1/saved_searches/destroy/id.json - * @param id The id of the saved search to be deleted. - * @return the data for a destroyed saved search - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.8 + /** + * Destroys a saved search for the authenticated user. The search specified by id must be owned by the authenticating user. + *
This method calls http://api.twitter.com/1/saved_searches/destroy/id.json + * + * @param id The id of the saved search to be deleted. + * @return the data for a destroyed saved search + * @throws TwitterException when Twitter service or network is unavailable * @see POST saved_searches/destroy/:id | dev.twitter.com - */ - SavedSearch destroySavedSearch(int id) - throws TwitterException; + * @since Twitter4J 2.0.8 + */ + SavedSearch destroySavedSearch(int id) + throws TwitterException; } diff --git a/twitter4j-core/src/main/java/twitter4j/api/SavedSearchesMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/SavedSearchesMethodsAsync.java index 233709f07..8ed2ca81b 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/SavedSearchesMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/SavedSearchesMethodsAsync.java @@ -1,33 +1,24 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; /** * @author Joern Huxhorn - jhuxhorn at googlemail.com */ + /** * Not yet implemented. */ diff --git a/twitter4j-core/src/main/java/twitter4j/api/SearchMethods.java b/twitter4j-core/src/main/java/twitter4j/api/SearchMethods.java index 10da6879f..bdc5d70a3 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/SearchMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/SearchMethods.java @@ -1,52 +1,39 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.Query; import twitter4j.QueryResult; -import twitter4j.Trends; import twitter4j.TwitterException; -import java.util.Date; -import java.util.List; - /** * @author Joern Huxhorn - jhuxhorn at googlemail.com */ public interface SearchMethods { - /** - * Returns tweets that match a specified query. - *
This method calls http://search.twitter.com/search.json - * @param query - the search condition - * @return the result - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 1.1.7 + /** + * Returns tweets that match a specified query. + *
This method calls http://search.twitter.com/search.json + * + * @param query - the search condition + * @return the result + * @throws TwitterException when Twitter service or network is unavailable * @see GET search | dev.twitter.com * @see Twitter API / Search Operators - */ + * @since Twitter4J 1.1.7 + */ QueryResult search(Query query) throws TwitterException; } diff --git a/twitter4j-core/src/main/java/twitter4j/api/SearchMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/SearchMethodsAsync.java index 435ab16c9..3fe469fbc 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/SearchMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/SearchMethodsAsync.java @@ -1,47 +1,35 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; -import java.util.Date; - import twitter4j.Query; /** * @author Joern Huxhorn - jhuxhorn at googlemail.com */ public interface SearchMethodsAsync { - /** - * Returns tweets that match a specified query. - *
This method calls http://search.twitter.com/search.json - * - * @param query - the search condition - * @since Twitter4J 1.1.7 + /** + * Returns tweets that match a specified query. + *
This method calls http://search.twitter.com/search.json + * + * @param query - the search condition * @see GET search | dev.twitter.com - * @see Twitter API / Search Operators - */ - void search(Query query); + * @see Twitter API / Search Operators + * @since Twitter4J 1.1.7 + */ + void search(Query query); } diff --git a/twitter4j-core/src/main/java/twitter4j/api/SpamReportingMethods.java b/twitter4j-core/src/main/java/twitter4j/api/SpamReportingMethods.java index 5bde31db5..abaa5a03e 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/SpamReportingMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/SpamReportingMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.TwitterException; diff --git a/twitter4j-core/src/main/java/twitter4j/api/SpamReportingMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/SpamReportingMethodsAsync.java index 9234f9541..de045aa67 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/SpamReportingMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/SpamReportingMethodsAsync.java @@ -1,39 +1,28 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; -import twitter4j.TwitterException; - /** * @author Joern Huxhorn - jhuxhorn at googlemail.com */ + /** * Not yet supported. - * + *

* http://yusuke.homeip.net/jira/browse/TFJ-223 */ public interface SpamReportingMethodsAsync { diff --git a/twitter4j-core/src/main/java/twitter4j/api/StatusMethods.java b/twitter4j-core/src/main/java/twitter4j/api/StatusMethods.java index dc74041dd..7509edfcb 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/StatusMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/StatusMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.IDs; diff --git a/twitter4j-core/src/main/java/twitter4j/api/StatusMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/StatusMethodsAsync.java index ac0b3230f..85fe798b8 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/StatusMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/StatusMethodsAsync.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.StatusUpdate; diff --git a/twitter4j-core/src/main/java/twitter4j/api/TimelineMethods.java b/twitter4j-core/src/main/java/twitter4j/api/TimelineMethods.java index 724d1822e..c414d98de 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/TimelineMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/TimelineMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.Paging; @@ -275,7 +265,7 @@ public interface TimelineMethods { *
This method calls http://api.twitter.com/1/statuses/retweeted_to_user * * @param screenName the user to view - * @param paging controls pagination. Supports since_id, max_id, count and page parameters. + * @param paging controls pagination. Supports since_id, max_id, count and page parameters. * @return the 20 most recent retweets posted by the authenticating user's friends. * @throws TwitterException when Twitter service or network is unavailable * @see #newtwitter and the API - Twitter API Announcements | Google Group @@ -305,7 +295,7 @@ ResponseList getRetweetedToUser(int userId, Paging paging) *
This method calls http://api.twitter.com/1/statuses/retweeted_by_user * * @param screenName the user to view - * @param paging controls pagination. Supports since_id, max_id, count and page parameters. + * @param paging controls pagination. Supports since_id, max_id, count and page parameters. * @return the 20 most recent retweets posted by the authenticating user * @throws TwitterException when Twitter service or network is unavailable * @see #newtwitter and the API - Twitter API Announcements | Google Group diff --git a/twitter4j-core/src/main/java/twitter4j/api/TimelineMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/TimelineMethodsAsync.java index 4ffa18817..acf511f36 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/TimelineMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/TimelineMethodsAsync.java @@ -1,217 +1,218 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.Paging; -import twitter4j.ResponseList; -import twitter4j.Status; -import twitter4j.TwitterException; /** * @author Joern Huxhorn - jhuxhorn at googlemail.com */ public interface TimelineMethodsAsync { - /** + /** * Returns the 20 most recent statuses from non-protected users who have set a custom user icon. The public timeline is cached for 60 seconds and requesting it more often than that is unproductive and a waste of resources. - *
This method calls http://api.twitter.com/1/statuses/public_timeline + *
This method calls http://api.twitter.com/1/statuses/public_timeline + * * @see GET statuses/public_timeline | dev.twitter.com - */ - void getPublicTimeline(); + */ + void getPublicTimeline(); - /** + /** * Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends. This is the equivalent of /timeline/home on the Web.
* Usage note: This home_timeline call is identical to statuses/friends_timeline, except that home_timeline also contains retweets, while statuses/friends_timeline does not for backwards compatibility reasons. In a future version of the API, statuses/friends_timeline will be deprected and replaced by home_timeline. - *
This method calls http://api.twitter.com/1/statuses/home_timeline - * + *
This method calls http://api.twitter.com/1/statuses/home_timeline + * * @see GET statuses/home_timeline | dev.twitter.com - * @since Twitter4J 2.0.10 - */ - void getHomeTimeline(); + * @since Twitter4J 2.0.10 + */ + void getHomeTimeline(); - /** + /** * Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends. This is the equivalent of /timeline/home on the Web.
* Usage note: This home_timeline call is identical to statuses/friends_timeline, except that home_timeline also contains retweets, while statuses/friends_timeline does not for backwards compatibility reasons. In a future version of the API, statuses/friends_timeline will be deprected and replaced by home_timeline. - *
This method calls http://api.twitter.com/1/statuses/home_timeline - * - * @param paging controls pagination + *
This method calls http://api.twitter.com/1/statuses/home_timeline + * + * @param paging controls pagination * @see GET statuses/home_timeline | dev.twitter.com - * @since Twitter4J 2.0.10 - */ - void getHomeTimeline(Paging paging); + * @since Twitter4J 2.0.10 + */ + void getHomeTimeline(Paging paging); - /** + /** * Returns the 20 most recent statuses posted by the authenticating user and that user's friends. This is the equivalent of /timeline/home on the Web. + * * @see GET statuses/friends_timeline | dev.twitter.com - */ - void getFriendsTimeline(); + */ + void getFriendsTimeline(); - /** + /** * Returns the 20 most recent statuses posted by the authenticating user and that user's friends. This is the equivalent of /timeline/home on the Web. - *
This method calls http://api.twitter.com/1/statuses/friends_timeline - * @param paging controls pagination + *
This method calls http://api.twitter.com/1/statuses/friends_timeline + * + * @param paging controls pagination * @see GET statuses/friends_timeline | dev.twitter.com - * @since Twitter4J 2.0.1 - */ - void getFriendsTimeline(Paging paging); + * @since Twitter4J 2.0.1 + */ + void getFriendsTimeline(Paging paging); - /** + /** * Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter.
* This is the equivalent of the Web / page for your own user, or the profile page for a third party.
* For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with 'RT' in RSS and Atom). If you'd like them included, you can merge them in from statuses retweeted_by_me.
- *
This method calls http://api.twitter.com/1/statuses/user_timeline - * - * @param screenName Specifies the screen name of the user for whom to return the user_timeline. - * @param paging controls pagination + *
This method calls http://api.twitter.com/1/statuses/user_timeline + * + * @param screenName Specifies the screen name of the user for whom to return the user_timeline. + * @param paging controls pagination * @see GET statuses/user_timeline | dev.twitter.com - * @since Twitter4J 2.0.1 - */ - void getUserTimeline(String screenName, Paging paging); + * @since Twitter4J 2.0.1 + */ + void getUserTimeline(String screenName, Paging paging); - /** + /** * Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter.
* This is the equivalent of the Web / page for your own user, or the profile page for a third party.
* For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with 'RT' in RSS and Atom). If you'd like them included, you can merge them in from statuses retweeted_by_me.
- *
This method calls http://api.twitter.com/1/statuses/user_timeline - * - * @param userId Specifies the ID of the user for whom to return the user_timeline. - * @param paging controls pagination + *
This method calls http://api.twitter.com/1/statuses/user_timeline + * + * @param userId Specifies the ID of the user for whom to return the user_timeline. + * @param paging controls pagination * @see GET statuses/user_timeline | dev.twitter.com - * @since Twitter4J 2.1.0 - */ - void getUserTimeline(int userId, Paging paging); + * @since Twitter4J 2.1.0 + */ + void getUserTimeline(int userId, Paging paging); - /** + /** * Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter.
* This is the equivalent of the Web / page for your own user, or the profile page for a third party.
* For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with 'RT' in RSS and Atom). If you'd like them included, you can merge them in from statuses retweeted_by_me.
- *
This method calls http://api.twitter.com/1/statuses/user_timeline - * - * @param paging controls pagination + *
This method calls http://api.twitter.com/1/statuses/user_timeline + * + * @param paging controls pagination * @see GET statuses/user_timeline | dev.twitter.com - * @since Twitter4J 2.0.1 - */ - void getUserTimeline(Paging paging); + * @since Twitter4J 2.0.1 + */ + void getUserTimeline(Paging paging); - /** + /** * Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter.
* This is the equivalent of the Web / page for your own user, or the profile page for a third party.
* For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with 'RT' in RSS and Atom). If you'd like them included, you can merge them in from statuses retweeted_by_me.
- *
This method calls http://api.twitter.com/1/statuses/user_timeline - * - * @param screenName Specifies the screen name of the user for whom to return the user_timeline. + *
This method calls http://api.twitter.com/1/statuses/user_timeline + * + * @param screenName Specifies the screen name of the user for whom to return the user_timeline. * @see GET statuses/user_timeline | dev.twitter.com - */ - void getUserTimeline(String screenName); + */ + void getUserTimeline(String screenName); - /** + /** * Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter.
* This is the equivalent of the Web / page for your own user, or the profile page for a third party.
* For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with 'RT' in RSS and Atom). If you'd like them included, you can merge them in from statuses retweeted_by_me.
- *
This method calls http://api.twitter.com/1/statuses/user_timeline - * - * @param userId Specifies the ID of the user for whom to return the user_timeline. + *
This method calls http://api.twitter.com/1/statuses/user_timeline + * + * @param userId Specifies the ID of the user for whom to return the user_timeline. * @see GET statuses/user_timeline | dev.twitter.com - * @since Twitter4J 2.1.0 - */ - void getUserTimeline(int userId); + * @since Twitter4J 2.1.0 + */ + void getUserTimeline(int userId); - /** + /** * Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter.
* This is the equivalent of the Web / page for your own user, or the profile page for a third party.
* For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with 'RT' in RSS and Atom). If you'd like them included, you can merge them in from statuses retweeted_by_me.
- *
This method calls http://api.twitter.com/1/statuses/user_timeline + *
This method calls http://api.twitter.com/1/statuses/user_timeline + * * @see GET statuses/user_timeline | dev.twitter.com - */ - void getUserTimeline(); + */ + void getUserTimeline(); - /** - * Returns the 20 most recent replies (status updates prefixed with @username) to the authenticating user. Replies are only available to the authenticating user; you can not request a list of replies to another user whether public or protected. - *
This method calls http://api.twitter.com/1/statuses/mentions - * @since Twitter4J 2.0.1 + /** + * Returns the 20 most recent replies (status updates prefixed with @username) to the authenticating user. Replies are only available to the authenticating user; you can not request a list of replies to another user whether public or protected. + *
This method calls http://api.twitter.com/1/statuses/mentions + * * @see GET statuses/mentions | dev.twitter.com - */ - void getMentions(); + * @since Twitter4J 2.0.1 + */ + void getMentions(); - /** - * Returns the 20 most recent replies (status updates prefixed with @username) to the authenticating user. Replies are only available to the authenticating user; you can not request a list of replies to another user whether public or protected. - *
This method calls http://api.twitter.com/1/statuses/mentions - * @param paging controls pagination - * @since Twitter4J 2.0.1 + /** + * Returns the 20 most recent replies (status updates prefixed with @username) to the authenticating user. Replies are only available to the authenticating user; you can not request a list of replies to another user whether public or protected. + *
This method calls http://api.twitter.com/1/statuses/mentions + * + * @param paging controls pagination * @see GET statuses/mentions | dev.twitter.com - */ - void getMentions(Paging paging); + * @since Twitter4J 2.0.1 + */ + void getMentions(Paging paging); - /** - * Returns the 20 most recent retweets posted by the authenticating user. - *
This method calls http://api.twitter.com/1/statuses/retweeted_by_me - * @since Twitter4J 2.0.10 + /** + * Returns the 20 most recent retweets posted by the authenticating user. + *
This method calls http://api.twitter.com/1/statuses/retweeted_by_me + * * @see GET statuses/retweeted_by_me | dev.twitter.com - */ - void getRetweetedByMe(); + * @since Twitter4J 2.0.10 + */ + void getRetweetedByMe(); - /** - * Returns the 20 most recent retweets posted by the authenticating user. - *
This method calls http://api.twitter.com/1/statuses/retweeted_by_me - * @param paging controls pagination - * @since Twitter4J 2.0.10 + /** + * Returns the 20 most recent retweets posted by the authenticating user. + *
This method calls http://api.twitter.com/1/statuses/retweeted_by_me + * + * @param paging controls pagination * @see GET statuses/retweeted_by_me | dev.twitter.com - */ - void getRetweetedByMe(Paging paging); + * @since Twitter4J 2.0.10 + */ + void getRetweetedByMe(Paging paging); - /** - * Returns the 20 most recent retweets posted by the authenticating user's friends. - *
This method calls http://api.twitter.com/1/statuses/retweeted_to_me - * @since Twitter4J 2.0.10 + /** + * Returns the 20 most recent retweets posted by the authenticating user's friends. + *
This method calls http://api.twitter.com/1/statuses/retweeted_to_me + * * @see GET statuses/retweeted_to_me | dev.twitter.com - */ - void getRetweetedToMe(); + * @since Twitter4J 2.0.10 + */ + void getRetweetedToMe(); - /** - * Returns the 20 most recent retweets posted by the authenticating user's friends. - *
This method calls http://api.twitter.com/1/statuses/retweeted_to_me - * @param paging controls pagination - * @since Twitter4J 2.0.10 + /** + * Returns the 20 most recent retweets posted by the authenticating user's friends. + *
This method calls http://api.twitter.com/1/statuses/retweeted_to_me + * + * @param paging controls pagination * @see GET statuses/retweeted_to_me | dev.twitter.com - */ - void getRetweetedToMe(Paging paging); + * @since Twitter4J 2.0.10 + */ + void getRetweetedToMe(Paging paging); + /** * Returns the 20 most recent tweets of the authenticated user that have been retweeted by others. *
This method calls http://api.twitter.com/1/statuses/retweets_of_me - * @since Twitter4J 2.0.10 + * * @see GET statuses/retweets_of_me | dev.twitter.com + * @since Twitter4J 2.0.10 */ void getRetweetsOfMe(); + /** * Returns the 20 most recent tweets of the authenticated user that have been retweeted by others. *
This method calls http://api.twitter.com/1/statuses/retweets_of_me + * * @param paging controls pagination - * @since Twitter4J 2.0.10 * @see GET statuses/retweets_of_me | dev.twitter.com + * @since Twitter4J 2.0.10 */ void getRetweetsOfMe(Paging paging); @@ -221,7 +222,7 @@ public interface TimelineMethodsAsync { *
This method calls http://api.twitter.com/1/statuses/retweeted_to_user * * @param screenName the user to view - * @param paging controls pagination. Supports since_id, max_id, count and page parameters. + * @param paging controls pagination. Supports since_id, max_id, count and page parameters. * @see #newtwitter and the API - Twitter API Announcements | Google Group * @since Twitter4J 2.1.9 */ @@ -245,7 +246,7 @@ public interface TimelineMethodsAsync { *
This method calls http://api.twitter.com/1/statuses/retweeted_by_user * * @param screenName the user to view - * @param paging controls pagination. Supports since_id, max_id, count and page parameters. + * @param paging controls pagination. Supports since_id, max_id, count and page parameters. * @see #newtwitter and the API - Twitter API Announcements | Google Group * @since Twitter4J 2.0.10 */ diff --git a/twitter4j-core/src/main/java/twitter4j/api/TrendsMethods.java b/twitter4j-core/src/main/java/twitter4j/api/TrendsMethods.java index ebdad01af..55942b6ab 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/TrendsMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/TrendsMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import twitter4j.Trends; @@ -39,78 +29,85 @@ public interface TrendsMethods { /** * Returns the top ten topics that are currently trending on Twitter. The response includes the time of the request, the name of each trend, and the url to the Twitter Search results page for that topic. - *
This method calls http://search.twitter.com/trends.json - * @return the result - * @throws twitter4j.TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.2 + *
This method calls http://search.twitter.com/trends.json + * + * @return the result + * @throws twitter4j.TwitterException when Twitter service or network is unavailable * @see GET trends | dev.twitter.com - */ + * @since Twitter4J 2.0.2 + */ Trends getTrends() throws TwitterException; /** * Returns the current top 10 trending topics on Twitter. The response includes the time of the request, the name of each trending topic, and query used on Twitter Search results page for that topic. - *
This method calls http://search.twitter.com/trends/current.json - * @return the result - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.2 + *
This method calls http://search.twitter.com/trends/current.json + * + * @return the result + * @throws TwitterException when Twitter service or network is unavailable * @see GET trends/current | dev.twitter.com - */ + * @since Twitter4J 2.0.2 + */ Trends getCurrentTrends() throws TwitterException; /** * Returns the current top 10 trending topics on Twitter. The response includes the time of the request, the name of each trending topic, and query used on Twitter Search results page for that topic. - *
This method calls http://search.twitter.com/trends/current.json - * @param excludeHashTags Setting this to true will remove all hashtags from the trends list. - * @return the result - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.2 + *
This method calls http://search.twitter.com/trends/current.json + * + * @param excludeHashTags Setting this to true will remove all hashtags from the trends list. + * @return the result + * @throws TwitterException when Twitter service or network is unavailable * @see GET trends/current | dev.twitter.com - */ + * @since Twitter4J 2.0.2 + */ Trends getCurrentTrends(boolean excludeHashTags) throws TwitterException; /** * Returns the top 20 trending topics for each hour in a given day. - *
This method calls http://search.twitter.com/trends/daily.json - * @return the result - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.2 + *
This method calls http://search.twitter.com/trends/daily.json + * + * @return the result + * @throws TwitterException when Twitter service or network is unavailable * @see GET trends/daily | dev.twitter.com - */ + * @since Twitter4J 2.0.2 + */ List getDailyTrends() throws TwitterException; /** * Returns the top 20 trending topics for each hour in a given day. - *
This method calls http://search.twitter.com/trends/daily.json - * @param date Permits specifying a start date for the report. - * @param excludeHashTags Setting this to true will remove all hashtags from the trends list. - * @return the result - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.2 + *
This method calls http://search.twitter.com/trends/daily.json + * + * @param date Permits specifying a start date for the report. + * @param excludeHashTags Setting this to true will remove all hashtags from the trends list. + * @return the result + * @throws TwitterException when Twitter service or network is unavailable * @see GET trends/daily | dev.twitter.com - */ - List getDailyTrends(Date date, boolean excludeHashTags) - throws TwitterException; + * @since Twitter4J 2.0.2 + */ + List getDailyTrends(Date date, boolean excludeHashTags) + throws TwitterException; - /** + /** * Returns the top 30 trending topics for each day in a given week. - *
This method calls http://search.twitter.com/trends/weekly.json - * @return the result - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.2 + *
This method calls http://search.twitter.com/trends/weekly.json + * + * @return the result + * @throws TwitterException when Twitter service or network is unavailable * @see GET trends/weekly | dev.twitter.com - */ + * @since Twitter4J 2.0.2 + */ List getWeeklyTrends() throws TwitterException; /** - * Returns the top 30 trending topics for each day in a given week. - *
This method calls http://search.twitter.com/trends/weekly.json - * @param date Permits specifying a start date for the report. - * @param excludeHashTags Setting this to true will remove all hashtags from the trends list. - * @return the result - * @throws TwitterException when Twitter service or network is unavailable - * @since Twitter4J 2.0.2 + * Returns the top 30 trending topics for each day in a given week. + *
This method calls http://search.twitter.com/trends/weekly.json + * + * @param date Permits specifying a start date for the report. + * @param excludeHashTags Setting this to true will remove all hashtags from the trends list. + * @return the result + * @throws TwitterException when Twitter service or network is unavailable * @see GET trends/weekly | dev.twitter.com - */ - List getWeeklyTrends(Date date, boolean excludeHashTags) - throws TwitterException; + * @since Twitter4J 2.0.2 + */ + List getWeeklyTrends(Date date, boolean excludeHashTags) + throws TwitterException; } diff --git a/twitter4j-core/src/main/java/twitter4j/api/TrendsMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/TrendsMethodsAsync.java index 1431bd702..796cfe0b1 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/TrendsMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/TrendsMethodsAsync.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.api; import java.util.Date; @@ -36,61 +26,68 @@ public interface TrendsMethodsAsync { /** * Returns the top ten topics that are currently trending on Twitter. The response includes the time of the request, the name of each trend, and the url to the Twitter Search results page for that topic. *
This method calls http://search.twitter.com/trends.json - * @since Twitter4J 2.0.2 + * * @see GET trends | dev.twitter.com + * @since Twitter4J 2.0.2 */ void getTrends(); /** * Returns the current top 10 trending topics on Twitter. The response includes the time of the request, the name of each trending topic, and query used on Twitter Search results page for that topic. *
This method calls http://search.twitter.com/trends/current.json - * @since Twitter4J 2.0.2 + * * @see GET trends/current | dev.twitter.com + * @since Twitter4J 2.0.2 */ void getCurrentTrends(); /** * Returns the current top 10 trending topics on Twitter. The response includes the time of the request, the name of each trending topic, and query used on Twitter Search results page for that topic. *
This method calls http://search.twitter.com/trends/current.json + * * @param excludeHashTags Setting this to true will remove all hashtags from the trends list. - * @since Twitter4J 2.0.2 * @see GET trends/current | dev.twitter.com + * @since Twitter4J 2.0.2 */ void getCurrentTrends(boolean excludeHashTags); /** * Returns the top 20 trending topics for each hour in a given day. *
This method calls http://search.twitter.com/trends/daily.json - * @since Twitter4J 2.0.2 + * * @see GET trends/daily | dev.twitter.com + * @since Twitter4J 2.0.2 */ void getDailyTrends(); /** * Returns the top 20 trending topics for each hour in a given day. *
This method calls http://search.twitter.com/trends/daily.json - * @param date Permits specifying a start date for the report. + * + * @param date Permits specifying a start date for the report. * @param excludeHashTags Setting this to true will remove all hashtags from the trends list. - * @since Twitter4J 2.0.2 * @see GET trends/daily | dev.twitter.com + * @since Twitter4J 2.0.2 */ void getDailyTrends(Date date, boolean excludeHashTags); /** * Returns the top 30 trending topics for each day in a given week. *
This method calls http://search.twitter.com/trends/weekly.json - * @since Twitter4J 2.0.2 + * * @see GET trends/weekly | dev.twitter.com + * @since Twitter4J 2.0.2 */ void getWeeklyTrends(); /** * Returns the top 30 trending topics for each day in a given week. *
This method calls http://search.twitter.com/trends/weekly.json - * @param date Permits specifying a start date for the report. + * + * @param date Permits specifying a start date for the report. * @param excludeHashTags Setting this to true will remove all hashtags from the trends list. - * @since Twitter4J 2.0.2 * @see GET trends/weekly | dev.twitter.com + * @since Twitter4J 2.0.2 */ void getWeeklyTrends(Date date, boolean excludeHashTags); } diff --git a/twitter4j-core/src/main/java/twitter4j/api/UserMethods.java b/twitter4j-core/src/main/java/twitter4j/api/UserMethods.java index 5b4902257..c93b7ac1e 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/UserMethods.java +++ b/twitter4j-core/src/main/java/twitter4j/api/UserMethods.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.api; import twitter4j.Category; diff --git a/twitter4j-core/src/main/java/twitter4j/api/UserMethodsAsync.java b/twitter4j-core/src/main/java/twitter4j/api/UserMethodsAsync.java index c988e231d..ca981ed4c 100644 --- a/twitter4j-core/src/main/java/twitter4j/api/UserMethodsAsync.java +++ b/twitter4j-core/src/main/java/twitter4j/api/UserMethodsAsync.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.api; import twitter4j.ProfileImage; diff --git a/twitter4j-core/src/main/java/twitter4j/conf/Configuration.java b/twitter4j-core/src/main/java/twitter4j/conf/Configuration.java index 5a39ccac6..00fad0a5d 100644 --- a/twitter4j-core/src/main/java/twitter4j/conf/Configuration.java +++ b/twitter4j-core/src/main/java/twitter4j/conf/Configuration.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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; import twitter4j.http.AuthorizationConfiguration; diff --git a/twitter4j-core/src/main/java/twitter4j/conf/ConfigurationBase.java b/twitter4j-core/src/main/java/twitter4j/conf/ConfigurationBase.java index 210a730b9..101668988 100644 --- a/twitter4j-core/src/main/java/twitter4j/conf/ConfigurationBase.java +++ b/twitter4j-core/src/main/java/twitter4j/conf/ConfigurationBase.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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; import twitter4j.Version; diff --git a/twitter4j-core/src/main/java/twitter4j/conf/ConfigurationBuilder.java b/twitter4j-core/src/main/java/twitter4j/conf/ConfigurationBuilder.java index 65913570a..3097a77b0 100644 --- a/twitter4j-core/src/main/java/twitter4j/conf/ConfigurationBuilder.java +++ b/twitter4j-core/src/main/java/twitter4j/conf/ConfigurationBuilder.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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; import java.util.Properties; diff --git a/twitter4j-core/src/main/java/twitter4j/conf/ConfigurationContext.java b/twitter4j-core/src/main/java/twitter4j/conf/ConfigurationContext.java index a34281181..3b3f8edba 100644 --- a/twitter4j-core/src/main/java/twitter4j/conf/ConfigurationContext.java +++ b/twitter4j-core/src/main/java/twitter4j/conf/ConfigurationContext.java @@ -1,35 +1,26 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.conf; /** * Static factory of Configuration. This class wraps ConfigurationFactory implementations.
* By default, twitter4j.conf.PropertyConfigurationFactory will be used and can be changed with -Dtwitter4j.configurationFactory system property. + * * @author Yusuke Yamamoto - yusuke at mac.com */ public final class ConfigurationContext { @@ -47,7 +38,7 @@ public final class ConfigurationContext { } try { - factory = (ConfigurationFactory)Class.forName(CONFIG_IMPL).newInstance(); + factory = (ConfigurationFactory) Class.forName(CONFIG_IMPL).newInstance(); } catch (ClassNotFoundException cnfe) { throw new AssertionError(cnfe); } catch (InstantiationException ie) { @@ -61,6 +52,7 @@ public final class ConfigurationContext { public static Configuration getInstance() { return factory.getInstance(); } + public static Configuration getInstance(String configTreePath) { return factory.getInstance(configTreePath); } diff --git a/twitter4j-core/src/main/java/twitter4j/conf/ConfigurationFactory.java b/twitter4j-core/src/main/java/twitter4j/conf/ConfigurationFactory.java index 05ce0ee07..2bb8a3735 100644 --- a/twitter4j-core/src/main/java/twitter4j/conf/ConfigurationFactory.java +++ b/twitter4j-core/src/main/java/twitter4j/conf/ConfigurationFactory.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.conf; /** @@ -32,12 +22,14 @@ public interface ConfigurationFactory { /** * returns the root configuration + * * @return root configuration */ Configuration getInstance(); /** * returns the configuration specified by the path + * * @param configTreePath the path * @return the configuratoin */ diff --git a/twitter4j-core/src/main/java/twitter4j/conf/PropertyConfiguration.java b/twitter4j-core/src/main/java/twitter4j/conf/PropertyConfiguration.java index 0eaf0693c..4be35858f 100644 --- a/twitter4j-core/src/main/java/twitter4j/conf/PropertyConfiguration.java +++ b/twitter4j-core/src/main/java/twitter4j/conf/PropertyConfiguration.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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; import twitter4j.internal.util.StringUtil; diff --git a/twitter4j-core/src/main/java/twitter4j/conf/PropertyConfigurationFactory.java b/twitter4j-core/src/main/java/twitter4j/conf/PropertyConfigurationFactory.java index 5e36a91dd..54455c2cc 100644 --- a/twitter4j-core/src/main/java/twitter4j/conf/PropertyConfigurationFactory.java +++ b/twitter4j-core/src/main/java/twitter4j/conf/PropertyConfigurationFactory.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.conf; /** @@ -32,9 +22,10 @@ * * @author Yusuke Yamamoto - yusuke at mac.com */ -class PropertyConfigurationFactory implements ConfigurationFactory{ +class PropertyConfigurationFactory implements ConfigurationFactory { private static final PropertyConfiguration ROOT_CONFIGURATION; - static{ + + static { ROOT_CONFIGURATION = new PropertyConfiguration(); } @@ -46,6 +37,7 @@ public Configuration getInstance() { } // It may be preferable to cache the config instance + /** * {@inheritDoc} */ @@ -56,7 +48,7 @@ public Configuration getInstance(String configTreePath) { /** * {@inheritDoc} */ - public void dispose(){ + public void dispose() { // nothing to do for property based configuration } } diff --git a/twitter4j-core/src/main/java/twitter4j/http/AccessToken.java b/twitter4j-core/src/main/java/twitter4j/http/AccessToken.java index 5125bd90d..88fc70052 100644 --- a/twitter4j-core/src/main/java/twitter4j/http/AccessToken.java +++ b/twitter4j-core/src/main/java/twitter4j/http/AccessToken.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.http; import twitter4j.TwitterException; @@ -32,12 +22,14 @@ /** * Representing authorized Access Token which is passed to the service provider in order to access protected resources.
* the token and token secret can be stored into some persistent stores such as file system or RDBMS for the further accesses. + * * @author Yusuke Yamamoto - yusuke at mac.com */ public class AccessToken extends OAuthToken implements java.io.Serializable { private static final long serialVersionUID = -8344528374458826291L; private String screenName; private int userId; + AccessToken(HttpResponse res) throws TwitterException { this(res.asString()); } @@ -56,24 +48,22 @@ public AccessToken(String token, String tokenSecret) { } /** - * * @return screen name * @since Twitter4J 2.0.4 */ - public String getScreenName() { - return screenName; - } + public String getScreenName() { + return screenName; + } /** - * * @return user id * @since Twitter4J 2.0.4 */ - public int getUserId() { - return userId; - } + public int getUserId() { + return userId; + } @Override public boolean equals(Object o) { diff --git a/twitter4j-core/src/main/java/twitter4j/http/Authorization.java b/twitter4j-core/src/main/java/twitter4j/http/Authorization.java index a641cfe17..a0db6fca1 100644 --- a/twitter4j-core/src/main/java/twitter4j/http/Authorization.java +++ b/twitter4j-core/src/main/java/twitter4j/http/Authorization.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.http; import twitter4j.internal.http.HttpRequest; @@ -38,6 +28,7 @@ public interface Authorization extends java.io.Serializable { /** * Returns true if authorization credentials are set. + * * @return true if authorization credentials are set */ boolean isEnabled(); diff --git a/twitter4j-core/src/main/java/twitter4j/http/AuthorizationConfiguration.java b/twitter4j-core/src/main/java/twitter4j/http/AuthorizationConfiguration.java index a29eaee26..7a3af7163 100644 --- a/twitter4j-core/src/main/java/twitter4j/http/AuthorizationConfiguration.java +++ b/twitter4j-core/src/main/java/twitter4j/http/AuthorizationConfiguration.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.http; /** diff --git a/twitter4j-core/src/main/java/twitter4j/http/AuthorizationFactory.java b/twitter4j-core/src/main/java/twitter4j/http/AuthorizationFactory.java index 1ff1064a1..fb36b7a1f 100644 --- a/twitter4j-core/src/main/java/twitter4j/http/AuthorizationFactory.java +++ b/twitter4j-core/src/main/java/twitter4j/http/AuthorizationFactory.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.http; import twitter4j.conf.Configuration; diff --git a/twitter4j-core/src/main/java/twitter4j/http/BasicAuthorization.java b/twitter4j-core/src/main/java/twitter4j/http/BasicAuthorization.java index 4612ab1c4..7c36b945c 100644 --- a/twitter4j-core/src/main/java/twitter4j/http/BasicAuthorization.java +++ b/twitter4j-core/src/main/java/twitter4j/http/BasicAuthorization.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.http; import twitter4j.internal.http.BASE64Encoder; diff --git a/twitter4j-core/src/main/java/twitter4j/http/NullAuthorization.java b/twitter4j-core/src/main/java/twitter4j/http/NullAuthorization.java index fedfe3ab0..02f80eec2 100644 --- a/twitter4j-core/src/main/java/twitter4j/http/NullAuthorization.java +++ b/twitter4j-core/src/main/java/twitter4j/http/NullAuthorization.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.http; import twitter4j.internal.http.HttpRequest; diff --git a/twitter4j-core/src/main/java/twitter4j/http/OAuthAuthorization.java b/twitter4j-core/src/main/java/twitter4j/http/OAuthAuthorization.java index 3bd4e018f..3cc0cbbbc 100644 --- a/twitter4j-core/src/main/java/twitter4j/http/OAuthAuthorization.java +++ b/twitter4j-core/src/main/java/twitter4j/http/OAuthAuthorization.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.http; import twitter4j.TwitterException; diff --git a/twitter4j-core/src/main/java/twitter4j/http/OAuthToken.java b/twitter4j-core/src/main/java/twitter4j/http/OAuthToken.java index f391e071b..f5909bc17 100644 --- a/twitter4j-core/src/main/java/twitter4j/http/OAuthToken.java +++ b/twitter4j-core/src/main/java/twitter4j/http/OAuthToken.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.http; import twitter4j.TwitterException; @@ -37,10 +27,10 @@ abstract class OAuthToken implements java.io.Serializable { private static final long serialVersionUID = 3891133932519746686L; private String token; private String tokenSecret; - + private transient SecretKeySpec secretKeySpec; String[] responseStr = null; - + public OAuthToken(String token, String tokenSecret) { this.token = token; this.tokenSecret = tokenSecret; @@ -49,6 +39,7 @@ public OAuthToken(String token, String tokenSecret) { OAuthToken(HttpResponse response) throws TwitterException { this(response.asString()); } + OAuthToken(String string) { responseStr = StringUtil.split(string, "&"); tokenSecret = getParameter("oauth_token_secret"); @@ -72,11 +63,11 @@ public String getTokenSecret() { } public String getParameter(String parameter) { - String value = null; + String value = null; for (String str : responseStr) { - if (str.startsWith(parameter+'=')) { - value = StringUtil.split(str, "=")[1].trim(); - break; + if (str.startsWith(parameter + '=')) { + value = StringUtil.split(str, "=")[1].trim(); + break; } } return value; diff --git a/twitter4j-core/src/main/java/twitter4j/http/RequestToken.java b/twitter4j-core/src/main/java/twitter4j/http/RequestToken.java index c5c0d3a65..8a8be965c 100644 --- a/twitter4j-core/src/main/java/twitter4j/http/RequestToken.java +++ b/twitter4j-core/src/main/java/twitter4j/http/RequestToken.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.http; import twitter4j.TwitterException; diff --git a/twitter4j-core/src/main/java/twitter4j/internal/async/Dispatcher.java b/twitter4j-core/src/main/java/twitter4j/internal/async/Dispatcher.java index b812aa908..c68bd8c5a 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/async/Dispatcher.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/async/Dispatcher.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.async; /** diff --git a/twitter4j-core/src/main/java/twitter4j/internal/async/DispatcherConfiguration.java b/twitter4j-core/src/main/java/twitter4j/internal/async/DispatcherConfiguration.java index 53c81fe30..c781ecb86 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/async/DispatcherConfiguration.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/async/DispatcherConfiguration.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.async; /** diff --git a/twitter4j-core/src/main/java/twitter4j/internal/async/DispatcherFactory.java b/twitter4j-core/src/main/java/twitter4j/internal/async/DispatcherFactory.java index aac3aba67..4d363a72f 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/async/DispatcherFactory.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/async/DispatcherFactory.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.async; import twitter4j.conf.ConfigurationContext; diff --git a/twitter4j-core/src/main/java/twitter4j/internal/async/DispatcherImpl.java b/twitter4j-core/src/main/java/twitter4j/internal/async/DispatcherImpl.java index 3a0a718ee..ec07cd488 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/async/DispatcherImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/async/DispatcherImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.async; import java.util.LinkedList; diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/BASE64Encoder.java b/twitter4j-core/src/main/java/twitter4j/internal/http/BASE64Encoder.java index c8f4ef5d2..03eb4f8fc 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/http/BASE64Encoder.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/http/BASE64Encoder.java @@ -1,34 +1,26 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.http; + /** * A utility class encodes byte array into String using Base64 encoding scheme. - * @see HttpClient + * * @author Yusuke Yamamoto - yusuke at mac.com + * @see HttpClient */ public final class BASE64Encoder { private static final char last2byte = (char) Integer.parseInt("00000011", 2); diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/HTMLEntity.java b/twitter4j-core/src/main/java/twitter4j/internal/http/HTMLEntity.java index a0ee36dc3..623b23da4 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/http/HTMLEntity.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/http/HTMLEntity.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. + * 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. + */ -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.http; import java.util.HashMap; diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClient.java b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClient.java index 7323b5f5a..eaf424e56 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClient.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClient.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.http; import twitter4j.TwitterException; @@ -36,5 +26,6 @@ public interface HttpClient { HttpResponse request(HttpRequest req) throws TwitterException; + void shutdown(); } diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientConfiguration.java b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientConfiguration.java index 87d1ad4fb..2c241db97 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientConfiguration.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientConfiguration.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.http; /** diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientFactory.java b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientFactory.java index a51791ead..4c2ee7567 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientFactory.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientFactory.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.http; import twitter4j.internal.logging.Logger; diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientImpl.java b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientImpl.java index eb304f2b3..fccd3d7fd 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.http; import twitter4j.TwitterException; diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientWrapper.java b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientWrapper.java index 48877cfc7..bce83acdc 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientWrapper.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientWrapper.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.http; import twitter4j.TwitterException; diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientWrapperConfiguration.java b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientWrapperConfiguration.java index 4097551f3..dcc84b9f8 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientWrapperConfiguration.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientWrapperConfiguration.java @@ -1,36 +1,25 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. + * 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. + */ -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.http; import java.util.Map; -public interface HttpClientWrapperConfiguration extends HttpClientConfiguration{ +public interface HttpClientWrapperConfiguration extends HttpClientConfiguration { /** - * * @return request headers */ Map getRequestHeaders(); diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpParameter.java b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpParameter.java index dd8b0ba61..cd19db34b 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpParameter.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpParameter.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.http; import java.io.File; @@ -34,6 +24,7 @@ /** * A data class representing HTTP Post parameter + * * @author Yusuke Yamamoto - yusuke at mac.com */ public final class HttpParameter implements Comparable, java.io.Serializable { @@ -47,6 +38,7 @@ public HttpParameter(String name, String value) { this.name = name; this.value = value; } + public HttpParameter(String name, File file) { this.name = name; this.file = file; @@ -78,10 +70,11 @@ public HttpParameter(String name, boolean value) { this.value = String.valueOf(value); } - public String getName(){ + public String getName() { return name; } - public String getValue(){ + + public String getValue() { return value; } @@ -89,15 +82,15 @@ public File getFile() { return file; } - public InputStream getFileBody(){ - return fileBody; + public InputStream getFileBody() { + return fileBody; } - public boolean isFile(){ + public boolean isFile() { return null != file; } - public boolean hasFileBody(){ + public boolean hasFileBody() { return null != fileBody; } @@ -107,7 +100,6 @@ public boolean hasFileBody(){ private static final String OCTET = "application/octet-stream"; /** - * * @return content-type */ public String getContentType() { @@ -165,7 +157,7 @@ public boolean equals(Object o) { public static boolean containsFile(HttpParameter[] params) { boolean containsFile = false; - if(null == params){ + if (null == params) { return false; } for (HttpParameter param : params) { @@ -176,7 +168,9 @@ public static boolean containsFile(HttpParameter[] params) { } return containsFile; } - /*package*/ static boolean containsFile(List params) { + + /*package*/ + static boolean containsFile(List params) { boolean containsFile = false; for (HttpParameter param : params) { if (param.isFile()) { @@ -188,10 +182,11 @@ public static boolean containsFile(HttpParameter[] params) { } public static HttpParameter[] getParameterArray(String name, String value) { - return new HttpParameter[]{new HttpParameter(name,value)}; + return new HttpParameter[]{new HttpParameter(name, value)}; } + public static HttpParameter[] getParameterArray(String name, int value) { - return getParameterArray(name,String.valueOf(value)); + return getParameterArray(name, String.valueOf(value)); } public static HttpParameter[] getParameterArray(String name1, String value1 @@ -199,9 +194,10 @@ public static HttpParameter[] getParameterArray(String name1, String value1 return new HttpParameter[]{new HttpParameter(name1, value1) , new HttpParameter(name2, value2)}; } + public static HttpParameter[] getParameterArray(String name1, int value1 , String name2, int value2) { - return getParameterArray(name1,String.valueOf(value1),name2,String.valueOf(value2)); + return getParameterArray(name1, String.valueOf(value1), name2, String.valueOf(value2)); } @Override diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpRequest.java b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpRequest.java index 8f163a009..1465bda4e 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpRequest.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpRequest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.http; import twitter4j.http.Authorization; diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponse.java b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponse.java index 8f0ccc41a..6b2eda053 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponse.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponse.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.http; import twitter4j.TwitterException; diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponseCode.java b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponseCode.java index 4d07bd5ea..757af1c88 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponseCode.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponseCode.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.http; /** diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponseEvent.java b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponseEvent.java index e9aacb661..c208f7d03 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponseEvent.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponseEvent.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.http; diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponseImpl.java b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponseImpl.java index fafdfff2f..d38d42455 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponseImpl.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponseImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.http; import java.io.IOException; diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/RequestMethod.java b/twitter4j-core/src/main/java/twitter4j/internal/http/RequestMethod.java index f5e54f71c..515c2cadc 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/http/RequestMethod.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/http/RequestMethod.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.http; import java.io.ObjectStreamException; @@ -31,7 +21,6 @@ import java.util.Map; /** - * * @author Dan Checkoway - dcheckoway at gmail.com */ public final class RequestMethod implements java.io.Serializable { diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/XAuthAuthorization.java b/twitter4j-core/src/main/java/twitter4j/internal/http/XAuthAuthorization.java index 4cd9cbc24..912a11c28 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/http/XAuthAuthorization.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/http/XAuthAuthorization.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.http; import twitter4j.http.Authorization; @@ -33,7 +23,7 @@ * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.1.3 */ -public class XAuthAuthorization implements Authorization, java.io.Serializable{ +public class XAuthAuthorization implements Authorization, java.io.Serializable { private BasicAuthorization basic; private String consumerKey; @@ -48,11 +38,11 @@ public String getAuthorizationHeader(HttpRequest req) { return basic.getAuthorizationHeader(req); } - public String getUserId(){ + public String getUserId() { return basic.getUserId(); } - public String getPassword(){ + public String getPassword() { return basic.getPassword(); } @@ -68,6 +58,7 @@ public synchronized void setOAuthConsumer(String consumerKey, String consumerSec this.consumerKey = consumerKey; this.consumerSecret = consumerSecret; } + public boolean isEnabled() { return basic.isEnabled(); } diff --git a/twitter4j-core/src/main/java/twitter4j/internal/json/DataObjectFactoryUtil.java b/twitter4j-core/src/main/java/twitter4j/internal/json/DataObjectFactoryUtil.java index 781a5af0e..1196a5548 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/json/DataObjectFactoryUtil.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/json/DataObjectFactoryUtil.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.json; import twitter4j.json.DataObjectFactory; @@ -34,34 +24,38 @@ /** * provides public access to package private methods of twitter4j.json.DataObjectFactory class.
* This class is intended to + * * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.1.7 */ public class DataObjectFactoryUtil { - private DataObjectFactoryUtil(){ + private DataObjectFactoryUtil() { throw new AssertionError("not intended to be instantiated."); } + private static final Method CLEAR_THREAD_LOCAL_MAP; private static final Method REGISTER_JSON_OBJECT; - static{ + + static { Method[] methods = DataObjectFactory.class.getDeclaredMethods(); Method clearThreadLocalMap = null; Method registerJSONObject = null; - for (Method method : methods){ - if(method.getName().equals("clearThreadLocalMap")){ + for (Method method : methods) { + if (method.getName().equals("clearThreadLocalMap")) { clearThreadLocalMap = method; clearThreadLocalMap.setAccessible(true); - }else if(method.getName().equals("registerJSONObject")){ + } else if (method.getName().equals("registerJSONObject")) { registerJSONObject = method; registerJSONObject.setAccessible(true); } } - if(null == clearThreadLocalMap || null == registerJSONObject){ + if (null == clearThreadLocalMap || null == registerJSONObject) { throw new AssertionError(); } CLEAR_THREAD_LOCAL_MAP = clearThreadLocalMap; REGISTER_JSON_OBJECT = registerJSONObject; } + /** * provides a public access to {DAOFactory#clearThreadLocalMap} */ diff --git a/twitter4j-core/src/main/java/twitter4j/internal/logging/CommonsLoggingLogger.java b/twitter4j-core/src/main/java/twitter4j/internal/logging/CommonsLoggingLogger.java index db503aa2f..3e2898b3a 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/logging/CommonsLoggingLogger.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/logging/CommonsLoggingLogger.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.logging; /** @@ -34,7 +24,7 @@ final class CommonsLoggingLogger extends Logger { private final org.apache.commons.logging.Log LOGGER; - CommonsLoggingLogger(org.apache.commons.logging.Log logger){ + CommonsLoggingLogger(org.apache.commons.logging.Log logger) { LOGGER = logger; } diff --git a/twitter4j-core/src/main/java/twitter4j/internal/logging/CommonsLoggingLoggerFactory.java b/twitter4j-core/src/main/java/twitter4j/internal/logging/CommonsLoggingLoggerFactory.java index 9b6b53e7c..54e4b73a1 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/logging/CommonsLoggingLoggerFactory.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/logging/CommonsLoggingLoggerFactory.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.logging; /** diff --git a/twitter4j-core/src/main/java/twitter4j/internal/logging/Log4JLogger.java b/twitter4j-core/src/main/java/twitter4j/internal/logging/Log4JLogger.java index f64aada9b..85e134722 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/logging/Log4JLogger.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/logging/Log4JLogger.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.logging; /** @@ -33,7 +23,7 @@ final class Log4JLogger extends Logger { private final org.apache.log4j.Logger LOGGER; - Log4JLogger(org.apache.log4j.Logger logger){ + Log4JLogger(org.apache.log4j.Logger logger) { LOGGER = logger; } diff --git a/twitter4j-core/src/main/java/twitter4j/internal/logging/Log4JLoggerFactory.java b/twitter4j-core/src/main/java/twitter4j/internal/logging/Log4JLoggerFactory.java index bb8840e23..de2fb0fe1 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/logging/Log4JLoggerFactory.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/logging/Log4JLoggerFactory.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.logging; /** diff --git a/twitter4j-core/src/main/java/twitter4j/internal/logging/Logger.java b/twitter4j-core/src/main/java/twitter4j/internal/logging/Logger.java index b41adae35..a9724daca 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/logging/Logger.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/logging/Logger.java @@ -1,33 +1,21 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.logging; -import java.security.AccessControlException; - /** * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.1.0 @@ -38,7 +26,7 @@ public abstract class Logger { static { LoggerFactory loggerFactory = null; - try{ + try { //-Dtwitter4j.debug=true -Dtwitter4j.loggerFactory=twitter4j.internal.logging.StdOutLoggerFactory String loggerFactoryImpl = System.getProperty(LOGGER_FACTORY_IMPLEMENTATION); if (null != loggerFactoryImpl) { @@ -75,7 +63,7 @@ public abstract class Logger { loggerFactory = new StdOutLoggerFactory(); } LOGGER_FACTORY = loggerFactory; - loggerFactory.getLogger(Logger.class).debug("Will use "+loggerFactory.getClass() + " as logging factory."); + loggerFactory.getLogger(Logger.class).debug("Will use " + loggerFactory.getClass() + " as logging factory."); } private static LoggerFactory getLoggerFactory(String checkClassName, String implementationClass) { @@ -94,66 +82,64 @@ private static LoggerFactory getLoggerFactory(String checkClassName, String impl /** * Returns a Logger instance associated with the specified class. + * * @param clazz class * @return logger instance */ - public static Logger getLogger(Class clazz){ + public static Logger getLogger(Class clazz) { return LOGGER_FACTORY.getLogger(clazz); } /** * tests if debug level logging is enabled + * * @return if debug level logging is enabled */ public abstract boolean isDebugEnabled(); /** * tests if info level logging is enabled + * * @return if info level logging is enabled */ public abstract boolean isInfoEnabled(); /** * tests if warn level logging is enabled + * * @return if warn level logging is enabled */ public abstract boolean isWarnEnabled(); /** - * * @param message message */ public abstract void debug(String message); /** - * - * @param message message + * @param message message * @param message2 message2 */ public abstract void debug(String message, String message2); /** - * * @param message message */ public abstract void info(String message); /** - * - * @param message message + * @param message message * @param message2 message2 */ public abstract void info(String message, String message2); /** - * * @param message message */ public abstract void warn(String message); /** - * - * @param message message + * @param message message * @param message2 message2 */ public abstract void warn(String message, String message2); diff --git a/twitter4j-core/src/main/java/twitter4j/internal/logging/LoggerFactory.java b/twitter4j-core/src/main/java/twitter4j/internal/logging/LoggerFactory.java index 8cb52b0b4..614a6f941 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/logging/LoggerFactory.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/logging/LoggerFactory.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.logging; /** @@ -34,6 +24,7 @@ public abstract class LoggerFactory { /** * Returns a logger associated with the specified class. + * * @param clazz class * @return a logger instance */ diff --git a/twitter4j-core/src/main/java/twitter4j/internal/logging/NullLogger.java b/twitter4j-core/src/main/java/twitter4j/internal/logging/NullLogger.java index a5bca82cd..40784c646 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/logging/NullLogger.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/logging/NullLogger.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.logging; /** diff --git a/twitter4j-core/src/main/java/twitter4j/internal/logging/NullLoggerFactory.java b/twitter4j-core/src/main/java/twitter4j/internal/logging/NullLoggerFactory.java index 67b27fdaa..b3d09944c 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/logging/NullLoggerFactory.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/logging/NullLoggerFactory.java @@ -1,36 +1,26 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.logging; /** * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.1.4 */ -final class NullLoggerFactory extends LoggerFactory { +final class NullLoggerFactory extends LoggerFactory { private static final Logger SINGLETON = new NullLogger(); /** diff --git a/twitter4j-core/src/main/java/twitter4j/internal/logging/SLF4JLogger.java b/twitter4j-core/src/main/java/twitter4j/internal/logging/SLF4JLogger.java index 84a1d4201..0576ceb57 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/logging/SLF4JLogger.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/logging/SLF4JLogger.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.logging; /** @@ -32,7 +22,8 @@ */ final class SLF4JLogger extends Logger { private final org.slf4j.Logger LOGGER; - SLF4JLogger(org.slf4j.Logger logger){ + + SLF4JLogger(org.slf4j.Logger logger) { LOGGER = logger; } diff --git a/twitter4j-core/src/main/java/twitter4j/internal/logging/SLF4JLoggerFactory.java b/twitter4j-core/src/main/java/twitter4j/internal/logging/SLF4JLoggerFactory.java index 1c849684a..7c2c7bed7 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/logging/SLF4JLoggerFactory.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/logging/SLF4JLoggerFactory.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.logging; /** diff --git a/twitter4j-core/src/main/java/twitter4j/internal/logging/StdOutLoggerFactory.java b/twitter4j-core/src/main/java/twitter4j/internal/logging/StdOutLoggerFactory.java index f6a4fc5b1..7ec59d110 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/logging/StdOutLoggerFactory.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/logging/StdOutLoggerFactory.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.logging; /** diff --git a/twitter4j-core/src/main/java/twitter4j/internal/util/ParseUtil.java b/twitter4j-core/src/main/java/twitter4j/internal/util/ParseUtil.java index fc29ffe85..037fd7415 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/util/ParseUtil.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/util/ParseUtil.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.util; import twitter4j.TwitterException; @@ -43,6 +33,7 @@ /** * A tiny parse utility class. + * * @author Yusuke Yamamoto - yusuke at mac.com */ public final class ParseUtil { @@ -115,7 +106,8 @@ public static Date getDate(String name, String format) throws TwitterException { public static int getInt(String name, JSONObject json) { return getInt(getRawString(name, json)); } - public static int getInt(String str){ + + public static int getInt(String str) { if (null == str || "".equals(str) || "null".equals(str)) { return -1; } else { @@ -137,7 +129,7 @@ public static long getLong(String str) { return -1; } else { // some count over 100 will be expressed as "100+" - if(str.endsWith("+")){ + if (str.endsWith("+")) { str = str.substring(0, str.length() - 1); return Long.valueOf(str) + 1; } diff --git a/twitter4j-core/src/main/java/twitter4j/internal/util/StringUtil.java b/twitter4j-core/src/main/java/twitter4j/internal/util/StringUtil.java index 69920f385..5ee1488f1 100644 --- a/twitter4j-core/src/main/java/twitter4j/internal/util/StringUtil.java +++ b/twitter4j-core/src/main/java/twitter4j/internal/util/StringUtil.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.util; import java.util.ArrayList; diff --git a/twitter4j-core/src/main/java/twitter4j/json/DataObjectFactory.java b/twitter4j-core/src/main/java/twitter4j/json/DataObjectFactory.java index 2d4dd4ba8..19230b555 100644 --- a/twitter4j-core/src/main/java/twitter4j/json/DataObjectFactory.java +++ b/twitter4j-core/src/main/java/twitter4j/json/DataObjectFactory.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.*; @@ -31,7 +21,6 @@ import twitter4j.internal.org.json.JSONException; import twitter4j.internal.org.json.JSONObject; -import java.lang.Object; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.HashMap; @@ -63,6 +52,7 @@ private DataObjectFactory() { private static final Constructor relatedResultsConstructor; private static final Constructor statusDeletionNoticeConstructor; private static final Constructor accountTotalsConstructor; + static { try { statusConstructor = (Constructor) Class.forName("twitter4j.StatusJSONImpl").getDeclaredConstructor(JSONObject.class); @@ -109,7 +99,7 @@ private DataObjectFactory() { relatedResultsConstructor = (Constructor) Class.forName("twitter4j.RelatedResultsJSONImpl").getDeclaredConstructor(JSONArray.class); relatedResultsConstructor.setAccessible(true); - + statusDeletionNoticeConstructor = (Constructor) Class.forName("twitter4j.StatusDeletionNoticeImpl").getDeclaredConstructor(JSONObject.class); statusDeletionNoticeConstructor.setAccessible(true); @@ -151,6 +141,7 @@ public static String getRawJSON(Object obj) { /** * Constructs a Status object from rawJSON string. + * * @param rawJSON raw JSON form as String * @return Status * @throws TwitterException when provided string is not a valid JSON string. @@ -173,6 +164,7 @@ public static Status createStatus(String rawJSON) throws TwitterException { /** * Constructs a User object from rawJSON string. + * * @param rawJSON raw JSON form as String * @return User * @throws TwitterException when provided string is not a valid JSON string. @@ -195,6 +187,7 @@ public static User createUser(String rawJSON) throws TwitterException { /** * Constructs an AccountTotals object from rawJSON string. + * * @param rawJSON raw JSON form as String * @return AccountTotals * @throws TwitterException when provided string is not a valid JSON string. @@ -217,6 +210,7 @@ public static AccountTotals createAccountTotals(String rawJSON) throws TwitterEx /** * Constructs a Tweet object from rawJSON string. + * * @param rawJSON raw JSON form as String * @return Tweet * @throws TwitterException when provided string is not a valid JSON string. @@ -239,6 +233,7 @@ public static Tweet createTweet(String rawJSON) throws TwitterException { /** * Constructs a Relationship object from rawJSON string. + * * @param rawJSON raw JSON form as String * @return Relationship * @throws TwitterException when provided string is not a valid JSON string. @@ -261,6 +256,7 @@ public static Relationship createRelationship(String rawJSON) throws TwitterExce /** * Constructs a Place object from rawJSON string. + * * @param rawJSON raw JSON form as String * @return Place * @throws TwitterException when provided string is not a valid JSON string. @@ -283,6 +279,7 @@ public static Place createPlace(String rawJSON) throws TwitterException { /** * Constructs a SavedSearch object from rawJSON string. + * * @param rawJSON raw JSON form as String * @return SavedSearch * @throws TwitterException when provided string is not a valid JSON string. @@ -305,6 +302,7 @@ public static SavedSearch createSavedSearch(String rawJSON) throws TwitterExcept /** * Constructs a Trend object from rawJSON string. + * * @param rawJSON raw JSON form as String * @return Trend * @throws TwitterException when provided string is not a valid JSON string. @@ -327,6 +325,7 @@ public static Trend createTrend(String rawJSON) throws TwitterException { /** * Constructs a Trends object from rawJSON string. + * * @param rawJSON raw JSON form as String * @return Trends * @throws TwitterException when provided string is not a valid JSON string. @@ -346,6 +345,7 @@ public static Trends createTrends(String rawJSON) throws TwitterException { /** * Constructs a IDs object from rawJSON string. + * * @param rawJSON raw JSON form as String * @return IDs * @throws TwitterException when provided string is not a valid JSON string. @@ -365,6 +365,7 @@ public static IDs createIDs(String rawJSON) throws TwitterException { /** * Constructs a RateLimitStatus object from rawJSON string. + * * @param rawJSON raw JSON form as String * @return RateLimitStatus * @throws TwitterException when provided string is not a valid JSON string. @@ -387,6 +388,7 @@ public static RateLimitStatus createRateLimitStatus(String rawJSON) throws Twitt /** * Constructs a Category object from rawJSON string. + * * @param rawJSON raw JSON form as String * @return Category * @throws TwitterException when provided string is not a valid JSON string. @@ -409,6 +411,7 @@ public static Category createCategory(String rawJSON) throws TwitterException { /** * Constructs a DirectMessage object from rawJSON string. + * * @param rawJSON raw JSON form as String * @return DirectMessage * @throws TwitterException when provided string is not a valid JSON string. @@ -431,6 +434,7 @@ public static DirectMessage createDirectMessage(String rawJSON) throws TwitterEx /** * Constructs a Location object from rawJSON string. + * * @param rawJSON raw JSON form as String * @return Location * @throws TwitterException when provided string is not a valid JSON string. @@ -453,6 +457,7 @@ public static Location createLocation(String rawJSON) throws TwitterException { /** * Constructs a UserList object from rawJSON string. + * * @param rawJSON raw JSON form as String * @return UserList * @throws TwitterException when provided string is not a valid JSON string. @@ -475,6 +480,7 @@ public static UserList createUserList(String rawJSON) throws TwitterException { /** * Constructs a RelatedResults object from rawJSON string. + * * @param rawJSON raw JSON form as String * @return RelatedResults * @throws TwitterException when provided string is not a valid JSON string. @@ -507,9 +513,10 @@ public static RelatedResults createRelatedResults(String rawJSON) throws Twitter * NOTE: the raw JSONObject will be returned in cases where there isn't * a discrete respective object type that can be constructed. That way, * the caller can at least have access to the JSON itself. + * * @param rawJSON raw JSON form as String * @return the respective constructed object, or the JSONObject in the - * case where we cannot determine the object type. + * case where we cannot determine the object type. * @throws TwitterException when provided string is not a valid JSON string. * @since Twitter4J 2.1.9 */ @@ -551,6 +558,7 @@ public static Object createObject(String rawJSON) throws TwitterException { /** * clear raw JSON forms associated with the current thread.
* Currently this method is called indirectly by twitter4j.internal.util.DataObjectFactoryUtil, and should be called directly once *JSONImpl classes are migrated to twitter4j.json.* package. + * * @since Twitter4J 2.1.7 */ static void clearThreadLocalMap() { @@ -560,6 +568,7 @@ static void clearThreadLocalMap() { /** * associate a raw JSON form to the current thread
* Currently this method is called indirectly by twitter4j.internal.util.DataObjectFactoryUtil, and should be called directly once *JSONImpl classes are migrated to twitter4j.json.* package. + * * @since Twitter4J 2.1.7 */ static T registerJSONObject(T key, Object json) { diff --git a/twitter4j-core/src/main/java/twitter4j/json/JSONObjectType.java b/twitter4j-core/src/main/java/twitter4j/json/JSONObjectType.java index e6085fac7..8f4350010 100644 --- a/twitter4j-core/src/main/java/twitter4j/json/JSONObjectType.java +++ b/twitter4j-core/src/main/java/twitter4j/json/JSONObjectType.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.json; import twitter4j.internal.logging.Logger; diff --git a/twitter4j-core/src/main/java/twitter4j/util/CharacterUtil.java b/twitter4j-core/src/main/java/twitter4j/util/CharacterUtil.java index 3d59114e3..c6e30ef56 100644 --- a/twitter4j-core/src/main/java/twitter4j/util/CharacterUtil.java +++ b/twitter4j-core/src/main/java/twitter4j/util/CharacterUtil.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.util; /** @@ -31,12 +21,13 @@ * @since Twitter4J 2.1.2 */ public final class CharacterUtil { - private CharacterUtil(){ + private CharacterUtil() { throw new AssertionError(); } /** * Counts the length of the tweet + * * @param text tweet to be counted * @return the length of the tweet */ @@ -46,6 +37,7 @@ public static int count(String text) { /** * Returns true if the length of the string is exceeding length limitation + * * @param text String to be examined * @return if the length of the string is exceeding length limitation */ diff --git a/twitter4j-core/src/main/java/twitter4j/util/TimeSpanConverter.java b/twitter4j-core/src/main/java/twitter4j/util/TimeSpanConverter.java index 2d1f18ca0..37b3820a7 100644 --- a/twitter4j-core/src/main/java/twitter4j/util/TimeSpanConverter.java +++ b/twitter4j-core/src/main/java/twitter4j/util/TimeSpanConverter.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.util; import java.io.Serializable; diff --git a/twitter4j-core/src/main/resources/META-INF/LICENSE.txt b/twitter4j-core/src/main/resources/META-INF/LICENSE.txt index cf0d8e0e3..6b5c2d522 100644 --- a/twitter4j-core/src/main/resources/META-INF/LICENSE.txt +++ b/twitter4j-core/src/main/resources/META-INF/LICENSE.txt @@ -1,26 +1,179 @@ -Twitter4J includes software from JSON.org to parse JSON response from the Twitter API. You can see the license term at http://www.JSON.org/license.html - -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +Twitter4J SUBCOMPONENTS: + +Twitter4J includes software from JSON.org to parse JSON response from the Twitter API. You can see the license term at http://www.JSON.org/license.html \ No newline at end of file diff --git a/twitter4j-core/src/test/java/twitter4j/AsyncTwitterTest.java b/twitter4j-core/src/test/java/twitter4j/AsyncTwitterTest.java index 27467908f..a98cb68db 100644 --- a/twitter4j-core/src/test/java/twitter4j/AsyncTwitterTest.java +++ b/twitter4j-core/src/test/java/twitter4j/AsyncTwitterTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.http.AccessToken; diff --git a/twitter4j-core/src/test/java/twitter4j/AuthorizationTest.java b/twitter4j-core/src/test/java/twitter4j/AuthorizationTest.java index 5c5dd1476..1da3b15b5 100644 --- a/twitter4j-core/src/test/java/twitter4j/AuthorizationTest.java +++ b/twitter4j-core/src/test/java/twitter4j/AuthorizationTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import twitter4j.http.Authorization; diff --git a/twitter4j-core/src/test/java/twitter4j/DAOTest.java b/twitter4j-core/src/test/java/twitter4j/DAOTest.java index 5e6f3525d..22ca97c89 100644 --- a/twitter4j-core/src/test/java/twitter4j/DAOTest.java +++ b/twitter4j-core/src/test/java/twitter4j/DAOTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.conf.Configuration; diff --git a/twitter4j-core/src/test/java/twitter4j/PagingTest.java b/twitter4j-core/src/test/java/twitter4j/PagingTest.java index c02a5f2b7..19dba98f2 100644 --- a/twitter4j-core/src/test/java/twitter4j/PagingTest.java +++ b/twitter4j-core/src/test/java/twitter4j/PagingTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. + * 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. + */ -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import junit.framework.TestCase; @@ -128,15 +118,16 @@ public void testPaging() throws Exception { assertContains(params, "count", 3000); } - private void assertContains(java.util.List params, String name, long value){ + + private void assertContains(java.util.List params, String name, long value) { boolean contains = false; - for(HttpParameter param : params){ - if(param.getName().equals(name) && param.getValue().equals(String.valueOf(value))){ + for (HttpParameter param : params) { + if (param.getName().equals(name) && param.getValue().equals(String.valueOf(value))) { contains = true; break; } } - if(!contains){ + if (!contains) { fail("expected parameter " + name + ":" + value + " not found."); } diff --git a/twitter4j-core/src/test/java/twitter4j/SSLTestUnit.java b/twitter4j-core/src/test/java/twitter4j/SSLTestUnit.java index db718d486..a1ce4d271 100644 --- a/twitter4j-core/src/test/java/twitter4j/SSLTestUnit.java +++ b/twitter4j-core/src/test/java/twitter4j/SSLTestUnit.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; /** diff --git a/twitter4j-core/src/test/java/twitter4j/SearchAPITest.java b/twitter4j-core/src/test/java/twitter4j/SearchAPITest.java index 3a0207068..ec0742739 100644 --- a/twitter4j-core/src/test/java/twitter4j/SearchAPITest.java +++ b/twitter4j-core/src/test/java/twitter4j/SearchAPITest.java @@ -1,42 +1,33 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.http.HttpParameter; import java.text.SimpleDateFormat; -import java.util.List; import java.util.Date; +import java.util.List; public class SearchAPITest extends TwitterTestBase { public SearchAPITest(String name) { super(name); } + protected void setUp() throws Exception { super.setUp(); } @@ -44,24 +35,27 @@ protected void setUp() throws Exception { protected void tearDown() throws Exception { super.tearDown(); } + public void testQuery() throws Exception { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Query query = new Query("test") - .until(format.format(new java.util.Date(System.currentTimeMillis() - 3600*24))); + .until(format.format(new java.util.Date(System.currentTimeMillis() - 3600 * 24))); HttpParameter[] params = query.asHttpParameterArray(); - assertTrue(findParameter(params,"q")); - assertTrue(findParameter(params,"until")); + assertTrue(findParameter(params, "q")); + assertTrue(findParameter(params, "until")); } - private boolean findParameter(HttpParameter[] params, String paramName){ + + private boolean findParameter(HttpParameter[] params, String paramName) { boolean found = false; - for(HttpParameter param: params){ - if(paramName.equals(param.getName())){ + for (HttpParameter param : params) { + if (paramName.equals(param.getName())) { found = true; break; } } return found; } + public void testSearch() throws Exception { String queryStr = "test"; SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); @@ -74,15 +68,15 @@ public void testSearch() throws Exception { assertEquals(15, queryResult.getResultsPerPage()); assertTrue(0 < queryResult.getCompletedIn()); assertEquals(1, queryResult.getPage()); - assertEquals(queryStr + " until:"+ dateStr, queryResult.getQuery()); + assertEquals(queryStr + " until:" + dateStr, queryResult.getQuery()); List tweets = queryResult.getTweets(); - assertTrue(1<=tweets.size()); + assertTrue(1 <= tweets.size()); assertNotNull(tweets.get(0).getText()); assertNotNull(tweets.get(0).getCreatedAt()); assertNotNull("from user", tweets.get(0).getFromUser()); assertTrue("fromUserId", -1 != tweets.get(0).getFromUserId()); - assertTrue(-1 != tweets.get(0).getId()); + assertTrue(-1 != tweets.get(0).getId()); // assertNotNull(tweets.get(0).getIsoLanguageCode()); String profileImageURL = tweets.get(0).getProfileImageUrl(); assertNotNull(profileImageURL); @@ -110,7 +104,7 @@ public void testSearch() throws Exception { assertEquals(queryStr, queryResult.getQuery()); assertTrue(0 < queryResult.getTweets().size()); query.setQuery("from:al3x"); - query.setGeoCode(new GeoLocation(37.78233252646689,-122.39301681518555) ,10,Query.KILOMETERS); + query.setGeoCode(new GeoLocation(37.78233252646689, -122.39301681518555), 10, Query.KILOMETERS); queryResult = unauthenticated.search(query); assertTrue(0 <= queryResult.getTweets().size()); @@ -123,7 +117,7 @@ public void testSearch() throws Exception { QueryResult result = twitter1.search(query); } - public void testTrends() throws Exception{ + public void testTrends() throws Exception { Trends trends; trends = unauthenticated.getTrends(); @@ -164,34 +158,34 @@ public void testTrends() throws Exception{ trendsList = unauthenticated.getDailyTrends(); assertTrue(100000 > (trends.getAsOf().getTime() - System.currentTimeMillis())); - assertTrends(trendsList,20); + assertTrends(trendsList, 20); trendsList = unauthenticated.getDailyTrends(new Date(), true); assertTrue(100000 > (trends.getAsOf().getTime() - System.currentTimeMillis())); - assertTrends(trendsList,20); + assertTrends(trendsList, 20); trendsList = unauthenticated.getWeeklyTrends(); assertTrue(100000 > (trends.getAsOf().getTime() - System.currentTimeMillis())); - assertTrends(trendsList,30); + assertTrends(trendsList, 30); trendsList = unauthenticated.getWeeklyTrends(new Date(), true); assertTrue(100000 > (trends.getAsOf().getTime() - System.currentTimeMillis())); - assertTrends(trendsList,30); + assertTrends(trendsList, 30); } - private void assertTrends(List trendsArray, int expectedSize) throws Exception{ + private void assertTrends(List trendsArray, int expectedSize) throws Exception { Date trendAt = null; - for(Trends singleTrends : trendsArray){ - assertEquals(expectedSize, singleTrends.getTrends().length); - if(null != trendAt){ - assertTrue(trendAt.before(singleTrends.getTrendAt())); - } - trendAt = singleTrends.getTrendAt(); - for (int i = 0; i < singleTrends.getTrends().length; i++) { - assertNotNull(singleTrends.getTrends()[i].getName()); - assertNull(singleTrends.getTrends()[i].getUrl()); - assertNotNull(singleTrends.getTrends()[i].getQuery()); - } - } + for (Trends singleTrends : trendsArray) { + assertEquals(expectedSize, singleTrends.getTrends().length); + if (null != trendAt) { + assertTrue(trendAt.before(singleTrends.getTrendAt())); + } + trendAt = singleTrends.getTrendAt(); + for (int i = 0; i < singleTrends.getTrends().length; i++) { + assertNotNull(singleTrends.getTrends()[i].getName()); + assertNull(singleTrends.getTrends()[i].getUrl()); + assertNotNull(singleTrends.getTrends()[i].getQuery()); + } + } } } diff --git a/twitter4j-core/src/test/java/twitter4j/SiteStreamsTest.java b/twitter4j-core/src/test/java/twitter4j/SiteStreamsTest.java index 5d62d627f..de47f4693 100644 --- a/twitter4j-core/src/test/java/twitter4j/SiteStreamsTest.java +++ b/twitter4j-core/src/test/java/twitter4j/SiteStreamsTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.conf.Configuration; diff --git a/twitter4j-core/src/test/java/twitter4j/SizeofStatusChecker.java b/twitter4j-core/src/test/java/twitter4j/SizeofStatusChecker.java index 6e0cd1e9d..3a21e7a2a 100644 --- a/twitter4j-core/src/test/java/twitter4j/SizeofStatusChecker.java +++ b/twitter4j-core/src/test/java/twitter4j/SizeofStatusChecker.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import org.w3c.dom.Document; @@ -32,6 +22,7 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import java.io.ByteArrayInputStream; + /** * @author Yusuke Yamamoto - yusuke at mac.com */ diff --git a/twitter4j-core/src/test/java/twitter4j/SpringCompatibilityTest.java b/twitter4j-core/src/test/java/twitter4j/SpringCompatibilityTest.java index adf0882f2..a3604c195 100644 --- a/twitter4j-core/src/test/java/twitter4j/SpringCompatibilityTest.java +++ b/twitter4j-core/src/test/java/twitter4j/SpringCompatibilityTest.java @@ -1,36 +1,25 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 junit.framework.TestCase; import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; -import twitter4j.conf.ConfigurationContext; import java.io.BufferedWriter; import java.io.File; @@ -62,11 +51,11 @@ protected void tearDown() throws Exception { } public void testFactoryInstantiation() throws Exception { - TwitterFactory twitterFactory = (TwitterFactory)beanFactory.getBean("twitterFactory"); + TwitterFactory twitterFactory = (TwitterFactory) beanFactory.getBean("twitterFactory"); Twitter twitter = twitterFactory.getInstance(); assertTrue(twitter instanceof Twitter); - AsyncTwitterFactory asyncTwitterFactory = (AsyncTwitterFactory)beanFactory.getBean("asyncTwitterFactory"); + AsyncTwitterFactory asyncTwitterFactory = (AsyncTwitterFactory) beanFactory.getBean("asyncTwitterFactory"); AsyncTwitter asyncTwitter = asyncTwitterFactory.getInstance(); assertTrue(asyncTwitter instanceof AsyncTwitter); diff --git a/twitter4j-core/src/test/java/twitter4j/StreamAPITest.java b/twitter4j-core/src/test/java/twitter4j/StreamAPITest.java index 2b42e311b..767cb642a 100644 --- a/twitter4j-core/src/test/java/twitter4j/StreamAPITest.java +++ b/twitter4j-core/src/test/java/twitter4j/StreamAPITest.java @@ -1,30 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ + * 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 twitter4j.http.AccessToken; diff --git a/twitter4j-core/src/test/java/twitter4j/Twitter4JTestSuite.java b/twitter4j-core/src/test/java/twitter4j/Twitter4JTestSuite.java index 6e1f9441c..983fde900 100644 --- a/twitter4j-core/src/test/java/twitter4j/Twitter4JTestSuite.java +++ b/twitter4j-core/src/test/java/twitter4j/Twitter4JTestSuite.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import junit.framework.Test; diff --git a/twitter4j-core/src/test/java/twitter4j/TwitterExceptionTest.java b/twitter4j-core/src/test/java/twitter4j/TwitterExceptionTest.java index c5754b725..51f16b64a 100644 --- a/twitter4j-core/src/test/java/twitter4j/TwitterExceptionTest.java +++ b/twitter4j-core/src/test/java/twitter4j/TwitterExceptionTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import junit.framework.TestCase; @@ -34,7 +24,7 @@ * @since Twitter4J 2.1.3 */ public class TwitterExceptionTest extends TestCase { - public TwitterExceptionTest(String name){ + public TwitterExceptionTest(String name) { super(name); } @@ -67,7 +57,7 @@ public void testException() throws Exception { public void testEncodedMessage() throws Exception { TwitterException te = new TwitterException("{\"error\":\"\\u3042\\u306a\\u305f\\u3092\\u30d5\\u30a9\\u30ed\\u30fc\\u3057\\u3066\\u3044\\u306a\\u3044\\u30e6\\u30fc\\u30b6\\u30fc\\u306b\\u30c0\\u30a4\\u30ec\\u30af\\u30c8\\u30e1\\u30c3\\u30bb\\u30fc\\u30b8\\u3092\\u9001\\u308b\\u3053\\u3068\\u304c\\u3067\\u304d\\u307e\\u305b\\u3093\\u3002\",\"request\":\"\\/1\\/direct_messages\\/new.json\"}"); assertTrue(-1 != te.getMessage().indexOf("あなたをフォローしていないユーザーにダイレクトメッセージを送ることができません。")); - } + } public void testGetLong() throws Exception { JSONObject json = new JSONObject("{\"value\":\"13857270119014401\"}"); diff --git a/twitter4j-core/src/test/java/twitter4j/TwitterTest.java b/twitter4j-core/src/test/java/twitter4j/TwitterTest.java index 30a114c50..53d50eb18 100644 --- a/twitter4j-core/src/test/java/twitter4j/TwitterTest.java +++ b/twitter4j-core/src/test/java/twitter4j/TwitterTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.json.DataObjectFactory; diff --git a/twitter4j-core/src/test/java/twitter4j/TwitterTestBase.java b/twitter4j-core/src/test/java/twitter4j/TwitterTestBase.java index 4fc0d5840..5f4051489 100644 --- a/twitter4j-core/src/test/java/twitter4j/TwitterTestBase.java +++ b/twitter4j-core/src/test/java/twitter4j/TwitterTestBase.java @@ -1,30 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ + * 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 junit.framework.TestCase; diff --git a/twitter4j-core/src/test/java/twitter4j/UserStreamTest.java b/twitter4j-core/src/test/java/twitter4j/UserStreamTest.java index 2b0a325fa..9623f61ba 100644 --- a/twitter4j-core/src/test/java/twitter4j/UserStreamTest.java +++ b/twitter4j-core/src/test/java/twitter4j/UserStreamTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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 twitter4j.internal.async.DispatcherFactory; diff --git a/twitter4j-core/src/test/java/twitter4j/conf/ConfigurationTest.java b/twitter4j-core/src/test/java/twitter4j/conf/ConfigurationTest.java index da4e04978..55308114b 100644 --- a/twitter4j-core/src/test/java/twitter4j/conf/ConfigurationTest.java +++ b/twitter4j-core/src/test/java/twitter4j/conf/ConfigurationTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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; import junit.framework.Assert; diff --git a/twitter4j-core/src/test/java/twitter4j/http/BASE64EncoderTest.java b/twitter4j-core/src/test/java/twitter4j/http/BASE64EncoderTest.java index f1dc16ca7..dbe745add 100644 --- a/twitter4j-core/src/test/java/twitter4j/http/BASE64EncoderTest.java +++ b/twitter4j-core/src/test/java/twitter4j/http/BASE64EncoderTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.http; import junit.framework.TestCase; diff --git a/twitter4j-core/src/test/java/twitter4j/http/HTMLEntityTest.java b/twitter4j-core/src/test/java/twitter4j/http/HTMLEntityTest.java index 0f5aab59f..bfee9022c 100644 --- a/twitter4j-core/src/test/java/twitter4j/http/HTMLEntityTest.java +++ b/twitter4j-core/src/test/java/twitter4j/http/HTMLEntityTest.java @@ -1,45 +1,36 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. + * 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. + */ -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.http; import junit.framework.TestCase; import twitter4j.internal.http.HTMLEntity; public class HTMLEntityTest extends TestCase { - public HTMLEntityTest(String name){ + public HTMLEntityTest(String name) { super(name); } - protected void setUp(){ + protected void setUp() { } - protected void tearDown(){ + + protected void tearDown() { } - public void testEscape(){ + public void testEscape() { String original = "<=% !>"; String expected = "<=% !>"; assertEquals(expected, HTMLEntity.escape(original)); @@ -47,7 +38,8 @@ public void testEscape(){ HTMLEntity.escape(buf); assertEquals(expected, buf.toString()); } - public void testUnescape(){ + + public void testUnescape() { String original = "<<=% ! >"; String expected = "<<=% !\u00A0>"; assertEquals(expected, HTMLEntity.unescape(original)); diff --git a/twitter4j-core/src/test/java/twitter4j/http/HttpClientTest.java b/twitter4j-core/src/test/java/twitter4j/http/HttpClientTest.java index 0def2ed96..4de74bfd8 100644 --- a/twitter4j-core/src/test/java/twitter4j/http/HttpClientTest.java +++ b/twitter4j-core/src/test/java/twitter4j/http/HttpClientTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.http; import twitter4j.TwitterTestBase; diff --git a/twitter4j-core/src/test/java/twitter4j/http/OAuthTest.java b/twitter4j-core/src/test/java/twitter4j/http/OAuthTest.java index 424a6fac7..c1663ca1f 100644 --- a/twitter4j-core/src/test/java/twitter4j/http/OAuthTest.java +++ b/twitter4j-core/src/test/java/twitter4j/http/OAuthTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.http; import twitter4j.StatusStream; diff --git a/twitter4j-core/src/test/java/twitter4j/http/PostParameterTest.java b/twitter4j-core/src/test/java/twitter4j/http/PostParameterTest.java index 571bf9e81..553cdd158 100644 --- a/twitter4j-core/src/test/java/twitter4j/http/PostParameterTest.java +++ b/twitter4j-core/src/test/java/twitter4j/http/PostParameterTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.http; import junit.framework.TestCase; @@ -32,7 +22,7 @@ import java.io.File; /** - * @author Yusuke Yamamoto - yusuke at mac.com + * @author Yusuke Yamamoto - yusuke at mac.com */ public class PostParameterTest extends TestCase { @@ -47,39 +37,41 @@ protected void setUp() throws Exception { protected void tearDown() throws Exception { super.tearDown(); } + public void testBooleanParameter() throws Exception { assertEquals("true", new HttpParameter("test", true).getValue()); assertEquals("false", new HttpParameter("test", false).getValue()); } public void testgetContentType() throws Exception { - assertValidContentType("image/jpeg","img.jpeg"); - assertValidContentType("image/jpeg","img.JPEG"); - assertValidContentType("image/jpeg","img.jpg"); - assertValidContentType("image/jpeg","img.JPG"); - assertValidContentType("image/jpeg","img.JpG"); - assertValidContentType("image/jpeg","img.jPg"); + assertValidContentType("image/jpeg", "img.jpeg"); + assertValidContentType("image/jpeg", "img.JPEG"); + assertValidContentType("image/jpeg", "img.jpg"); + assertValidContentType("image/jpeg", "img.JPG"); + assertValidContentType("image/jpeg", "img.JpG"); + assertValidContentType("image/jpeg", "img.jPg"); - assertValidContentType("image/gif","img.gif"); - assertValidContentType("image/gif","img.GIF"); - assertValidContentType("image/gif","img.GiF"); - assertValidContentType("image/gif","img.gIf"); + assertValidContentType("image/gif", "img.gif"); + assertValidContentType("image/gif", "img.GIF"); + assertValidContentType("image/gif", "img.GiF"); + assertValidContentType("image/gif", "img.gIf"); - assertValidContentType("image/png","img.png"); - assertValidContentType("image/png","img.PNG"); - assertValidContentType("image/png","img.PnG"); - assertValidContentType("image/png","img.pNg"); + assertValidContentType("image/png", "img.png"); + assertValidContentType("image/png", "img.PNG"); + assertValidContentType("image/png", "img.PnG"); + assertValidContentType("image/png", "img.pNg"); - assertValidContentType("application/octet-stream","img.jpegjpeg"); - assertValidContentType("application/octet-stream","img."); - assertValidContentType("application/octet-stream","img.els"); - assertValidContentType("application/octet-stream","img.ai"); - assertValidContentType("application/octet-stream","img.ps"); - assertValidContentType("application/octet-stream","img.txt"); - assertValidContentType("application/octet-stream","img"); + assertValidContentType("application/octet-stream", "img.jpegjpeg"); + assertValidContentType("application/octet-stream", "img."); + assertValidContentType("application/octet-stream", "img.els"); + assertValidContentType("application/octet-stream", "img.ai"); + assertValidContentType("application/octet-stream", "img.ps"); + assertValidContentType("application/octet-stream", "img.txt"); + assertValidContentType("application/octet-stream", "img"); } - private void assertValidContentType(String expected, String fileName){ + + private void assertValidContentType(String expected, String fileName) { HttpParameter param = new HttpParameter("file", new File(fileName)); assertEquals(expected, param.getContentType()); diff --git a/twitter4j-core/src/test/java/twitter4j/internal/async/DispatcherTest.java b/twitter4j-core/src/test/java/twitter4j/internal/async/DispatcherTest.java index 8b8189f6b..cb88ea6ad 100644 --- a/twitter4j-core/src/test/java/twitter4j/internal/async/DispatcherTest.java +++ b/twitter4j-core/src/test/java/twitter4j/internal/async/DispatcherTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.async; import junit.framework.TestCase; diff --git a/twitter4j-core/src/test/java/twitter4j/internal/util/ParseUtilTest.java b/twitter4j-core/src/test/java/twitter4j/internal/util/ParseUtilTest.java index b2e24a241..26c3deeab 100644 --- a/twitter4j-core/src/test/java/twitter4j/internal/util/ParseUtilTest.java +++ b/twitter4j-core/src/test/java/twitter4j/internal/util/ParseUtilTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.util; import junit.framework.TestCase; @@ -45,10 +35,11 @@ protected void tearDown() throws Exception { super.tearDown(); } - public void testParseLongReturns101(){ + public void testParseLongReturns101() { assertEquals(101, ParseUtil.getLong("100+")); } - public void testParseIntOverflow(){ + + public void testParseIntOverflow() { assertEquals(-1, ParseUtil.getInt("4294967295")); } } diff --git a/twitter4j-core/src/test/java/twitter4j/internal/util/StringUtilTest.java b/twitter4j-core/src/test/java/twitter4j/internal/util/StringUtilTest.java index 4ce445629..e14438d69 100644 --- a/twitter4j-core/src/test/java/twitter4j/internal/util/StringUtilTest.java +++ b/twitter4j-core/src/test/java/twitter4j/internal/util/StringUtilTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.util; import junit.framework.TestCase; diff --git a/twitter4j-core/src/test/java/twitter4j/util/CharacterUtilTest.java b/twitter4j-core/src/test/java/twitter4j/util/CharacterUtilTest.java index e32bd7c0e..188cc1e0f 100644 --- a/twitter4j-core/src/test/java/twitter4j/util/CharacterUtilTest.java +++ b/twitter4j-core/src/test/java/twitter4j/util/CharacterUtilTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.util; import junit.framework.TestCase; diff --git a/twitter4j-core/src/test/java/twitter4j/util/TimeSpanConverterTest.java b/twitter4j-core/src/test/java/twitter4j/util/TimeSpanConverterTest.java index d8cd27f79..9f009a86b 100644 --- a/twitter4j-core/src/test/java/twitter4j/util/TimeSpanConverterTest.java +++ b/twitter4j-core/src/test/java/twitter4j/util/TimeSpanConverterTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.util; import junit.framework.TestCase; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/account/GetAccountSettings.java b/twitter4j-examples/src/main/java/twitter4j/examples/account/GetAccountSettings.java index 2d943134f..4502dcf03 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/account/GetAccountSettings.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/account/GetAccountSettings.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.account; import twitter4j.AccountSettings; @@ -54,7 +44,7 @@ public static void main(String[] args) { System.out.println("Listing trend locations:"); Location[] locations = settings.getTrendLocations(); for (Location location : locations) { - System.out.println(" "+location.getName()); + System.out.println(" " + location.getName()); } System.exit(0); } catch (TwitterException te) { diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/account/GetAccountTotals.java b/twitter4j-examples/src/main/java/twitter4j/examples/account/GetAccountTotals.java index 6ec5ef71e..db324cd42 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/account/GetAccountTotals.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/account/GetAccountTotals.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.account; import twitter4j.AccountTotals; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/account/GetRateLimitStatus.java b/twitter4j-examples/src/main/java/twitter4j/examples/account/GetRateLimitStatus.java index 6432b22ec..990d69250 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/account/GetRateLimitStatus.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/account/GetRateLimitStatus.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.account; import twitter4j.RateLimitStatus; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfile.java b/twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfile.java index c72ab7657..bced4f0f3 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfile.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfile.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.account; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfileBackgroundImage.java b/twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfileBackgroundImage.java index fd3c488c5..b9e98d70a 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfileBackgroundImage.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfileBackgroundImage.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.account; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfileColors.java b/twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfileColors.java index 5e6db2414..567c1ecc1 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfileColors.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfileColors.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.account; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfileImage.java b/twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfileImage.java index 21c2ae374..e7da339d1 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfileImage.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfileImage.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.account; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/account/VerifyCredentials.java b/twitter4j-examples/src/main/java/twitter4j/examples/account/VerifyCredentials.java index eb31ccbc1..23ff0fb11 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/account/VerifyCredentials.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/account/VerifyCredentials.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.account; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/async/AsyncUpdate.java b/twitter4j-examples/src/main/java/twitter4j/examples/async/AsyncUpdate.java index 2984862e9..6a0558f87 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/async/AsyncUpdate.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/async/AsyncUpdate.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.async; import twitter4j.AsyncTwitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/block/CreateBlock.java b/twitter4j-examples/src/main/java/twitter4j/examples/block/CreateBlock.java index 309b43eec..007e8f81f 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/block/CreateBlock.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/block/CreateBlock.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.block; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/block/DestroyBlock.java b/twitter4j-examples/src/main/java/twitter4j/examples/block/DestroyBlock.java index 647655600..51bb4cebb 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/block/DestroyBlock.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/block/DestroyBlock.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.block; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/block/ExistsBlock.java b/twitter4j-examples/src/main/java/twitter4j/examples/block/ExistsBlock.java index fb82538be..a73ef7ed7 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/block/ExistsBlock.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/block/ExistsBlock.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.block; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/block/GetBlockingUsers.java b/twitter4j-examples/src/main/java/twitter4j/examples/block/GetBlockingUsers.java index bd39703a0..dde14f65d 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/block/GetBlockingUsers.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/block/GetBlockingUsers.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.block; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/block/GetBlockingUsersIDs.java b/twitter4j-examples/src/main/java/twitter4j/examples/block/GetBlockingUsersIDs.java index 1af313a6a..758858c7e 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/block/GetBlockingUsersIDs.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/block/GetBlockingUsersIDs.java @@ -1,38 +1,25 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.block; import twitter4j.IDs; import twitter4j.Twitter; import twitter4j.TwitterException; import twitter4j.TwitterFactory; -import twitter4j.User; - -import java.util.List; /** * List blocking user ids. diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/DestroyDirectMessage.java b/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/DestroyDirectMessage.java index e2fb13959..218751e1a 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/DestroyDirectMessage.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/DestroyDirectMessage.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.directmessage; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/GetDirectMessages.java b/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/GetDirectMessages.java index fac81b0e5..d855145fc 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/GetDirectMessages.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/GetDirectMessages.java @@ -1,32 +1,26 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.directmessage; -import twitter4j.*; +import twitter4j.DirectMessage; +import twitter4j.Paging; +import twitter4j.Twitter; +import twitter4j.TwitterException; +import twitter4j.TwitterFactory; import java.util.List; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/GetSentDirectMessages.java b/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/GetSentDirectMessages.java index a0bb09e4a..ff696bbc0 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/GetSentDirectMessages.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/GetSentDirectMessages.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.directmessage; import twitter4j.DirectMessage; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/SendDirectMessage.java b/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/SendDirectMessage.java index 011c2b02c..ffc67ba70 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/SendDirectMessage.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/SendDirectMessage.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.directmessage; import twitter4j.DirectMessage; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/ShowDirectMessage.java b/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/ShowDirectMessage.java index 725565fb8..2377e4878 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/ShowDirectMessage.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/directmessage/ShowDirectMessage.java @@ -1,32 +1,25 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.directmessage; -import twitter4j.*; +import twitter4j.DirectMessage; +import twitter4j.Twitter; +import twitter4j.TwitterException; +import twitter4j.TwitterFactory; /** * Example application that gets a specified direct message.
diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/favorite/CreateFavorite.java b/twitter4j-examples/src/main/java/twitter4j/examples/favorite/CreateFavorite.java index 7744a2254..4b0ae3c6c 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/favorite/CreateFavorite.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/favorite/CreateFavorite.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.favorite; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/favorite/DestroyFavorite.java b/twitter4j-examples/src/main/java/twitter4j/examples/favorite/DestroyFavorite.java index e2016b312..2529bdac2 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/favorite/DestroyFavorite.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/favorite/DestroyFavorite.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.favorite; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/favorite/GetFavorites.java b/twitter4j-examples/src/main/java/twitter4j/examples/favorite/GetFavorites.java index f19a6b36e..53775c98c 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/favorite/GetFavorites.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/favorite/GetFavorites.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.favorite; import twitter4j.Status; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/friendsandfollowers/GetFollowersIDs.java b/twitter4j-examples/src/main/java/twitter4j/examples/friendsandfollowers/GetFollowersIDs.java index 638ffefb1..d744b4ce8 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/friendsandfollowers/GetFollowersIDs.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/friendsandfollowers/GetFollowersIDs.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.friendsandfollowers; import twitter4j.IDs; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/friendsandfollowers/GetFriendsIDs.java b/twitter4j-examples/src/main/java/twitter4j/examples/friendsandfollowers/GetFriendsIDs.java index b1138132f..4e71c4267 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/friendsandfollowers/GetFriendsIDs.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/friendsandfollowers/GetFriendsIDs.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.friendsandfollowers; import twitter4j.IDs; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/friendship/CreateFriendship.java b/twitter4j-examples/src/main/java/twitter4j/examples/friendship/CreateFriendship.java index 0bc274bf7..869e82236 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/friendship/CreateFriendship.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/friendship/CreateFriendship.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.friendship; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/friendship/DestroyFriendship.java b/twitter4j-examples/src/main/java/twitter4j/examples/friendship/DestroyFriendship.java index 1418d065e..a056f2097 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/friendship/DestroyFriendship.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/friendship/DestroyFriendship.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.friendship; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/friendship/ExistsFriendship.java b/twitter4j-examples/src/main/java/twitter4j/examples/friendship/ExistsFriendship.java index 22ccfd404..2771b57a4 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/friendship/ExistsFriendship.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/friendship/ExistsFriendship.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.friendship; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/friendship/GetIncomingFriendships.java b/twitter4j-examples/src/main/java/twitter4j/examples/friendship/GetIncomingFriendships.java index 8392e5ed9..9bf3da0dc 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/friendship/GetIncomingFriendships.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/friendship/GetIncomingFriendships.java @@ -1,37 +1,25 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.friendship; import twitter4j.IDs; -import twitter4j.PagableResponseList; import twitter4j.Twitter; import twitter4j.TwitterException; import twitter4j.TwitterFactory; -import twitter4j.User; /** * Lists incoming friendships. diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/friendship/GetOutgoingFriendships.java b/twitter4j-examples/src/main/java/twitter4j/examples/friendship/GetOutgoingFriendships.java index 3e07ef568..a3c7aca30 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/friendship/GetOutgoingFriendships.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/friendship/GetOutgoingFriendships.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.friendship; import twitter4j.IDs; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/friendship/LookupFriendships.java b/twitter4j-examples/src/main/java/twitter4j/examples/friendship/LookupFriendships.java index 31683b832..1f5ab3c8c 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/friendship/LookupFriendships.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/friendship/LookupFriendships.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.friendship; import twitter4j.Friendship; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/friendship/ShowFriendship.java b/twitter4j-examples/src/main/java/twitter4j/examples/friendship/ShowFriendship.java index 7cebd0d40..4f0885822 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/friendship/ShowFriendship.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/friendship/ShowFriendship.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.friendship; import twitter4j.Relationship; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/friendship/UpdateFriendship.java b/twitter4j-examples/src/main/java/twitter4j/examples/friendship/UpdateFriendship.java index 35cd03ce4..2f1b1b2f6 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/friendship/UpdateFriendship.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/friendship/UpdateFriendship.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.friendship; import twitter4j.Relationship; @@ -51,7 +41,7 @@ public static void main(String[] args) { try { Twitter twitter = new TwitterFactory().getInstance(); Relationship relationship = twitter.updateFriendship(args[0] - ,Boolean.parseBoolean(args[1]), Boolean.parseBoolean(args[2])); + , Boolean.parseBoolean(args[1]), Boolean.parseBoolean(args[2])); System.out.println("Successfully updated the friendship of [" + relationship.getTargetUserScreenName() + "]."); System.exit(0); } catch (TwitterException te) { diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/geo/CreatePlace.java b/twitter4j-examples/src/main/java/twitter4j/examples/geo/CreatePlace.java index 20c5dee2d..a55e0b1ea 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/geo/CreatePlace.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/geo/CreatePlace.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.geo; import twitter4j.GeoLocation; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/geo/GetGeoDetails.java b/twitter4j-examples/src/main/java/twitter4j/examples/geo/GetGeoDetails.java index 366c227f9..00ede2e51 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/geo/GetGeoDetails.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/geo/GetGeoDetails.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.geo; import twitter4j.Place; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/geo/GetSimilarPlaces.java b/twitter4j-examples/src/main/java/twitter4j/examples/geo/GetSimilarPlaces.java index fabf37efd..c8ac8dd2c 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/geo/GetSimilarPlaces.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/geo/GetSimilarPlaces.java @@ -1,34 +1,23 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.geo; import twitter4j.GeoLocation; import twitter4j.Place; -import twitter4j.ResponseList; import twitter4j.SimilarPlaces; import twitter4j.Twitter; import twitter4j.TwitterException; @@ -59,7 +48,7 @@ public static void main(String[] args) { containedWithin = args[3]; } SimilarPlaces places = twitter.getSimilarPlaces(location, name, containedWithin, null); - System.out.println("token: "+ places.getToken()); + System.out.println("token: " + places.getToken()); if (places.size() == 0) { System.out.println("No location associated with the specified condition"); } else { diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/geo/ReverseGeoCode.java b/twitter4j-examples/src/main/java/twitter4j/examples/geo/ReverseGeoCode.java index 0aa5103fc..59dcd3ac1 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/geo/ReverseGeoCode.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/geo/ReverseGeoCode.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.geo; import twitter4j.GeoLocation; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/geo/SearchPlaces.java b/twitter4j-examples/src/main/java/twitter4j/examples/geo/SearchPlaces.java index 5338617ff..ff19c6321 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/geo/SearchPlaces.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/geo/SearchPlaces.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.geo; import twitter4j.GeoLocation; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/help/Test.java b/twitter4j-examples/src/main/java/twitter4j/examples/help/Test.java index 1204cb2d2..4ee76cab6 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/help/Test.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/help/Test.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.help; import twitter4j.Twitter; @@ -34,7 +24,7 @@ * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.1.7 */ -public class Test{ +public class Test { /** * Usage: java twitter4j.examples.help.Test * diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/json/LoadRawJSON.java b/twitter4j-examples/src/main/java/twitter4j/examples/json/LoadRawJSON.java index a274b362a..bf9c99626 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/json/LoadRawJSON.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/json/LoadRawJSON.java @@ -1,36 +1,31 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.json; import twitter4j.Status; import twitter4j.TwitterException; import twitter4j.json.DataObjectFactory; -import java.io.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FilenameFilter; +import java.io.IOException; +import java.io.InputStreamReader; /** * Example application that load raw JSON forms from statuses/ directory and dump status texts. @@ -45,15 +40,15 @@ public final class LoadRawJSON { */ public static void main(String[] args) { try { - File[] files = new File("statuses").listFiles(new FilenameFilter(){ - public boolean accept(File dir, String name){ + File[] files = new File("statuses").listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { return name.endsWith(".json"); - } + } }); - for(File file : files){ + for (File file : files) { String rawJSON = readFirstLine(file); Status status = DataObjectFactory.createStatus(rawJSON); - System.out.println("@"+ status.getUser().getScreenName() + " - " + status.getText()); + System.out.println("@" + status.getUser().getScreenName() + " - " + status.getText()); } System.exit(0); } catch (IOException ioe) { diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/json/SaveRawJSON.java b/twitter4j-examples/src/main/java/twitter4j/examples/json/SaveRawJSON.java index 6774e7356..2d1a7b520 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/json/SaveRawJSON.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/json/SaveRawJSON.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.json; import twitter4j.Status; @@ -32,7 +22,6 @@ import twitter4j.TwitterFactory; import twitter4j.json.DataObjectFactory; -import java.awt.image.ImagingOpException; import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; @@ -59,7 +48,7 @@ public static void main(String[] args) { List statuses = twitter.getPublicTimeline(); for (Status status : statuses) { String rawJSON = DataObjectFactory.getRawJSON(status); - String fileName = "statuses/"+status.getId()+".json"; + String fileName = "statuses/" + status.getId() + ".json"; storeJSON(rawJSON, fileName); System.out.println(fileName + " - " + status.getText()); } diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/legal/GetPrivacyPolicy.java b/twitter4j-examples/src/main/java/twitter4j/examples/legal/GetPrivacyPolicy.java index b9d4c81c1..24af4c845 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/legal/GetPrivacyPolicy.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/legal/GetPrivacyPolicy.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.legal; import twitter4j.Twitter; @@ -34,7 +24,7 @@ * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.1.7 */ -public class GetPrivacyPolicy{ +public class GetPrivacyPolicy { /** * Usage: java twitter4j.examples.legal.GetPrivacyPolicy * diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/legal/GetTermsOfService.java b/twitter4j-examples/src/main/java/twitter4j/examples/legal/GetTermsOfService.java index 771b4830f..bd801cace 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/legal/GetTermsOfService.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/legal/GetTermsOfService.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.legal; import twitter4j.Twitter; @@ -34,7 +24,7 @@ * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.1.7 */ -public class GetTermsOfService{ +public class GetTermsOfService { /** * Usage: java twitter4j.examples.legal.GetTermsOfService * diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/list/CreateUserList.java b/twitter4j-examples/src/main/java/twitter4j/examples/list/CreateUserList.java index 8e89a8d54..259c76848 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/list/CreateUserList.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/list/CreateUserList.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.list; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/list/DestroyUserList.java b/twitter4j-examples/src/main/java/twitter4j/examples/list/DestroyUserList.java index 089d1ce96..f5e50ce55 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/list/DestroyUserList.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/list/DestroyUserList.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.list; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/list/GetAllUserLists.java b/twitter4j-examples/src/main/java/twitter4j/examples/list/GetAllUserLists.java index 357d2284f..31496a8e6 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/list/GetAllUserLists.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/list/GetAllUserLists.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.list; import twitter4j.ResponseList; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserListMemberships.java b/twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserListMemberships.java index 813ebd103..e0d2708e0 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserListMemberships.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserListMemberships.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.list; import twitter4j.PagableResponseList; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserListStatuses.java b/twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserListStatuses.java index 3a82f8a9a..ae0322951 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserListStatuses.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserListStatuses.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.list; import twitter4j.Paging; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserListSubscriptions.java b/twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserListSubscriptions.java index d424a1384..a03f507f3 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserListSubscriptions.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserListSubscriptions.java @@ -1,32 +1,26 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.list; -import twitter4j.*; +import twitter4j.PagableResponseList; +import twitter4j.Twitter; +import twitter4j.TwitterException; +import twitter4j.TwitterFactory; +import twitter4j.UserList; /** * List the lists the specified user follows. diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserLists.java b/twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserLists.java index 3ea3695f4..ef79a3196 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserLists.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserLists.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.list; import twitter4j.PagableResponseList; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/list/ShowUserList.java b/twitter4j-examples/src/main/java/twitter4j/examples/list/ShowUserList.java index cbfd4f9ca..64a3179ba 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/list/ShowUserList.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/list/ShowUserList.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.list; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/list/UpdateUserList.java b/twitter4j-examples/src/main/java/twitter4j/examples/list/UpdateUserList.java index 2189a86d4..1749d08db 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/list/UpdateUserList.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/list/UpdateUserList.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.list; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/AddUserListMember.java b/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/AddUserListMember.java index 53092d55c..0567aefc8 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/AddUserListMember.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/AddUserListMember.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.listmembers; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/AddUserListMembers.java b/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/AddUserListMembers.java index fb4147c8b..7663fa051 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/AddUserListMembers.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/AddUserListMembers.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.listmembers; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/CheckUserListMembership.java b/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/CheckUserListMembership.java index a79108721..13dc444a6 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/CheckUserListMembership.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/CheckUserListMembership.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.listmembers; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/DeleteUserListMember.java b/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/DeleteUserListMember.java index d1c123fbc..55165d4de 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/DeleteUserListMember.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/DeleteUserListMember.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.listmembers; import twitter4j.Twitter; @@ -48,7 +38,7 @@ public static void main(String[] args) { } try { Twitter twitter = new TwitterFactory().getInstance(); - twitter.deleteUserListMember(Integer.parseInt(args[0]),Integer.parseInt(args[1])); + twitter.deleteUserListMember(Integer.parseInt(args[0]), Integer.parseInt(args[1])); System.out.println("Successfully deleted user [" + args[1] + "] from the list."); System.exit(0); } catch (TwitterException te) { diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/GetUserListMembers.java b/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/GetUserListMembers.java index baafaf525..49c3bc4e1 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/GetUserListMembers.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/listmembers/GetUserListMembers.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.listmembers; import twitter4j.PagableResponseList; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/CheckUserListSubscription.java b/twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/CheckUserListSubscription.java index 97416b328..71bec9921 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/CheckUserListSubscription.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/CheckUserListSubscription.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.listsubscribers; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/GetUserListSubscribers.java b/twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/GetUserListSubscribers.java index 72f35f9b3..359a4019f 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/GetUserListSubscribers.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/GetUserListSubscribers.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.listsubscribers; import twitter4j.PagableResponseList; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/SubscribeUserList.java b/twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/SubscribeUserList.java index 05e7e87c7..507b7ea42 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/SubscribeUserList.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/SubscribeUserList.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.listsubscribers; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/UnsubscribeUserList.java b/twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/UnsubscribeUserList.java index 1c4619592..653ba3f70 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/UnsubscribeUserList.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/UnsubscribeUserList.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.listsubscribers; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/media/ImgLyImageUpload.java b/twitter4j-examples/src/main/java/twitter4j/examples/media/ImgLyImageUpload.java index b5d008d97..5f05396b5 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/media/ImgLyImageUpload.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/media/ImgLyImageUpload.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.media; import twitter4j.TwitterException; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/media/PlixiImageUpload.java b/twitter4j-examples/src/main/java/twitter4j/examples/media/PlixiImageUpload.java index 6b03d664a..31e6aeec6 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/media/PlixiImageUpload.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/media/PlixiImageUpload.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.media; import twitter4j.TwitterException; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/media/TwippleImageUpload.java b/twitter4j-examples/src/main/java/twitter4j/examples/media/TwippleImageUpload.java index f645c9954..d7f6e84a7 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/media/TwippleImageUpload.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/media/TwippleImageUpload.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.media; import twitter4j.TwitterException; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/media/TwitgooImageUpload.java b/twitter4j-examples/src/main/java/twitter4j/examples/media/TwitgooImageUpload.java index 466320b72..7a466fc45 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/media/TwitgooImageUpload.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/media/TwitgooImageUpload.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.media; import twitter4j.TwitterException; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/media/TwitpicImageUpload.java b/twitter4j-examples/src/main/java/twitter4j/examples/media/TwitpicImageUpload.java index 4b2955b1f..2c869488f 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/media/TwitpicImageUpload.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/media/TwitpicImageUpload.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.media; import twitter4j.TwitterException; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/media/YFrogImageUpload.java b/twitter4j-examples/src/main/java/twitter4j/examples/media/YFrogImageUpload.java index 7aac3696c..8c1d0b4f5 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/media/YFrogImageUpload.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/media/YFrogImageUpload.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.media; import twitter4j.TwitterException; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/notification/DisableNotification.java b/twitter4j-examples/src/main/java/twitter4j/examples/notification/DisableNotification.java index d24e74042..be005a0d4 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/notification/DisableNotification.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/notification/DisableNotification.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.notification; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/notification/EnableNotification.java b/twitter4j-examples/src/main/java/twitter4j/examples/notification/EnableNotification.java index 9521e3418..a98b83cc1 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/notification/EnableNotification.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/notification/EnableNotification.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.notification; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/oauth/GetAccessToken.java b/twitter4j-examples/src/main/java/twitter4j/examples/oauth/GetAccessToken.java index d1d5596de..0ceaf6891 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/oauth/GetAccessToken.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/oauth/GetAccessToken.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.oauth; import twitter4j.Twitter; @@ -33,7 +23,14 @@ import twitter4j.http.RequestToken; import java.awt.*; -import java.io.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; import java.net.URI; import java.net.URISyntaxException; import java.util.Properties; @@ -45,6 +42,7 @@ public class GetAccessToken { /** * Usage: java twitter4j.examples.oauth.GetAccessToken [consumer key] [consumer secret] + * * @param args message */ public static void main(String[] args) { @@ -52,12 +50,12 @@ public static void main(String[] args) { Properties prop = new Properties(); InputStream is = null; OutputStream os = null; - try{ + try { if (file.exists()) { is = new FileInputStream(file); prop.load(is); } - if(args.length < 2){ + if (args.length < 2) { if (null == prop.getProperty("oauth.consumerKey") && null == prop.getProperty("oauth.consumerSecret")) { // consumer key/secret are not set in twitter4j.properties @@ -65,23 +63,23 @@ public static void main(String[] args) { "Usage: java twitter4j.examples.oauth.GetAccessToken [consumer key] [consumer secret]"); System.exit(-1); } - }else{ + } else { prop.setProperty("oauth.consumerKey", args[0]); prop.setProperty("oauth.consumerSecret", args[1]); os = new FileOutputStream("twitter4j.properties"); prop.store(os, "twitter4j.properties"); } - }catch(IOException ioe){ + } catch (IOException ioe) { ioe.printStackTrace(); System.exit(-1); - }finally{ - if(null != is){ + } finally { + if (null != is) { try { is.close(); } catch (IOException ignore) { } } - if(null != os){ + if (null != os) { try { os.close(); } catch (IOException ignore) { @@ -92,8 +90,8 @@ public static void main(String[] args) { Twitter twitter = new TwitterFactory().getInstance(); RequestToken requestToken = twitter.getOAuthRequestToken(); System.out.println("Got request token."); - System.out.println("Request token: "+ requestToken.getToken()); - System.out.println("Request token secret: "+ requestToken.getTokenSecret()); + System.out.println("Request token: " + requestToken.getToken()); + System.out.println("Request token secret: " + requestToken.getTokenSecret()); AccessToken accessToken = null; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); @@ -108,16 +106,16 @@ public static void main(String[] args) { } System.out.print("Enter the PIN(if available) and hit enter after you granted access.[PIN]:"); String pin = br.readLine(); - try{ - if(pin.length() > 0){ + try { + if (pin.length() > 0) { accessToken = twitter.getOAuthAccessToken(requestToken, pin); - }else{ + } else { accessToken = twitter.getOAuthAccessToken(requestToken); } } catch (TwitterException te) { - if(401 == te.getStatusCode()){ + if (401 == te.getStatusCode()) { System.out.println("Unable to get the access token."); - }else{ + } else { te.printStackTrace(); } } @@ -143,16 +141,16 @@ public static void main(String[] args) { } } } - System.out.println("Successfully stored access token to " + file.getAbsolutePath()+ "."); + System.out.println("Successfully stored access token to " + file.getAbsolutePath() + "."); System.exit(0); } catch (TwitterException te) { te.printStackTrace(); System.out.println("Failed to get accessToken: " + te.getMessage()); - System.exit( -1); + System.exit(-1); } catch (IOException ioe) { ioe.printStackTrace(); System.out.println("Failed to read the system input."); - System.exit( -1); + System.exit(-1); } } } diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/CreateSavedSearch.java b/twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/CreateSavedSearch.java index 3bbb19870..c58c63621 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/CreateSavedSearch.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/CreateSavedSearch.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.savedsearches; import twitter4j.SavedSearch; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/DestroySavedSearch.java b/twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/DestroySavedSearch.java index b4654c9dd..ce1e2f668 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/DestroySavedSearch.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/DestroySavedSearch.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.savedsearches; import twitter4j.SavedSearch; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/GetSavedSearches.java b/twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/GetSavedSearches.java index bade21667..b7f5d24af 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/GetSavedSearches.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/GetSavedSearches.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.savedsearches; import twitter4j.SavedSearch; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/ShowSavedSearch.java b/twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/ShowSavedSearch.java index 233fbbcdb..2f12ec328 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/ShowSavedSearch.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/ShowSavedSearch.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.savedsearches; import twitter4j.SavedSearch; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/search/SearchTweets.java b/twitter4j-examples/src/main/java/twitter4j/examples/search/SearchTweets.java index 597330f35..34c278340 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/search/SearchTweets.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/search/SearchTweets.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.search; import twitter4j.Query; @@ -32,12 +22,8 @@ import twitter4j.Twitter; import twitter4j.TwitterException; import twitter4j.TwitterFactory; -import twitter4j.http.AccessToken; -import twitter4j.http.RequestToken; -import java.io.*; import java.util.List; -import java.util.Properties; /** * @author Yusuke Yamamoto - yusuke at mac.com @@ -50,7 +36,7 @@ public class SearchTweets { * @param args */ public static void main(String[] args) { - if(args.length < 1){ + if (args.length < 1) { System.out.println("java twitter4j.examples.search.SearchTweets [query]"); System.exit(-1); } diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/spamreporting/ReportSpam.java b/twitter4j-examples/src/main/java/twitter4j/examples/spamreporting/ReportSpam.java index 0241783cb..83414692c 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/spamreporting/ReportSpam.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/spamreporting/ReportSpam.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.spamreporting; import twitter4j.Twitter; @@ -34,14 +24,14 @@ * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.1.7 */ -public class ReportSpam{ +public class ReportSpam { /** * Usage: java twitter4j.examples.spamreporting.ReportSpam [screen name] * * @param args String[] */ public static void main(String[] args) { - if(args.length < 1){ + if (args.length < 1) { System.out.println("java twitter4j.examples.spamreporting.ReportSpam [screen name]"); System.exit(-1); } diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintFilterStream.java b/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintFilterStream.java index 8b40e5b79..cdacf1ac9 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintFilterStream.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintFilterStream.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.stream; import twitter4j.FilterQuery; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintFirehoseStream.java b/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintFirehoseStream.java index 88a0fb9db..2d3503694 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintFirehoseStream.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintFirehoseStream.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.stream; import twitter4j.Status; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintLinksStream.java b/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintLinksStream.java index eab7a2e09..5d2716b9f 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintLinksStream.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintLinksStream.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.stream; import twitter4j.Status; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintRetweetStream.java b/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintRetweetStream.java index 5373960df..eade33a53 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintRetweetStream.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintRetweetStream.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.stream; import twitter4j.Status; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintSampleStream.java b/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintSampleStream.java index fcf5a9871..4711f47d9 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintSampleStream.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintSampleStream.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.stream; import twitter4j.Status; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintSiteStreams.java b/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintSiteStreams.java index 85f1dfc1f..53d7a725e 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintSiteStreams.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintSiteStreams.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.examples.stream; import twitter4j.DirectMessage; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintUserStream.java b/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintUserStream.java index e5749470f..bd3bc2ce3 100755 --- a/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintUserStream.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintUserStream.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * 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.examples.stream; import twitter4j.DirectMessage; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetFriendsTimeline.java b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetFriendsTimeline.java index bdb8ec160..aa3ae36bb 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetFriendsTimeline.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetFriendsTimeline.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.timeline; import twitter4j.Status; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetHomeTimeline.java b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetHomeTimeline.java index a607afa5d..f31ad1315 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetHomeTimeline.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetHomeTimeline.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.timeline; import twitter4j.Status; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetMentions.java b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetMentions.java index 858a419bf..b624e7671 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetMentions.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetMentions.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.timeline; import twitter4j.Status; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetPublicTimeline.java b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetPublicTimeline.java index 461bd9b8e..737d68ee5 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetPublicTimeline.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetPublicTimeline.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.timeline; import twitter4j.Status; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetedByMe.java b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetedByMe.java index 414f4ac2e..f180d3725 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetedByMe.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetedByMe.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.timeline; import twitter4j.Status; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetedByUser.java b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetedByUser.java index 5b40137ae..98d2964f4 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetedByUser.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetedByUser.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.timeline; import twitter4j.Paging; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetedToMe.java b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetedToMe.java index 9f4b04ba9..6f41e9d66 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetedToMe.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetedToMe.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.timeline; import twitter4j.Status; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetedToUser.java b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetedToUser.java index 23cb0213e..4e8b642aa 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetedToUser.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetedToUser.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.timeline; import twitter4j.Paging; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetsOfMe.java b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetsOfMe.java index 5a818e302..9aebeb7cc 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetsOfMe.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetRetweetsOfMe.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.timeline; import twitter4j.Status; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetUserTimeline.java b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetUserTimeline.java index 4891b2b96..be53e4f4a 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetUserTimeline.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetUserTimeline.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.timeline; import twitter4j.Status; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetAvailableTrends.java b/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetAvailableTrends.java index 9842950fa..18a0e6ec7 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetAvailableTrends.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetAvailableTrends.java @@ -1,32 +1,27 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.trends; -import twitter4j.*; +import twitter4j.GeoLocation; +import twitter4j.Location; +import twitter4j.ResponseList; +import twitter4j.Twitter; +import twitter4j.TwitterException; +import twitter4j.TwitterFactory; /** * Shows the locations that Twitter has trending topic information for. diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetCurrentTrends.java b/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetCurrentTrends.java index 66857dc84..874304db9 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetCurrentTrends.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetCurrentTrends.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.trends; import twitter4j.Trend; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetDailyTrends.java b/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetDailyTrends.java index 5bff443b7..e14a1bf3c 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetDailyTrends.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetDailyTrends.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.trends; import twitter4j.Trend; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetLocationTrends.java b/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetLocationTrends.java index 1240d4520..ea220aa7a 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetLocationTrends.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetLocationTrends.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.trends; import twitter4j.Trend; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetTrends.java b/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetTrends.java index aa2f011ea..8c1f646a0 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetTrends.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetTrends.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.trends; import twitter4j.Trend; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetWeeklyTrends.java b/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetWeeklyTrends.java index 08c782a26..0e6aff105 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetWeeklyTrends.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/trends/GetWeeklyTrends.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.trends; import twitter4j.Trend; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/tweets/DestroyStatus.java b/twitter4j-examples/src/main/java/twitter4j/examples/tweets/DestroyStatus.java index 67578c2a9..3b3e04ea2 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/tweets/DestroyStatus.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/tweets/DestroyStatus.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.tweets; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/tweets/GetRetweetedBy.java b/twitter4j-examples/src/main/java/twitter4j/examples/tweets/GetRetweetedBy.java index ca94e0493..4ec77f4a3 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/tweets/GetRetweetedBy.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/tweets/GetRetweetedBy.java @@ -1,32 +1,21 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.tweets; -import twitter4j.Paging; import twitter4j.Twitter; import twitter4j.TwitterException; import twitter4j.TwitterFactory; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/tweets/GetRetweetedByIds.java b/twitter4j-examples/src/main/java/twitter4j/examples/tweets/GetRetweetedByIds.java index 5f1395e6d..e144665a0 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/tweets/GetRetweetedByIds.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/tweets/GetRetweetedByIds.java @@ -1,39 +1,25 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.tweets; import twitter4j.IDs; -import twitter4j.Paging; import twitter4j.Twitter; import twitter4j.TwitterException; import twitter4j.TwitterFactory; -import twitter4j.User; - -import java.util.List; /** * Show user ids of up to 100 users who retweeted the specified status. diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/tweets/GetRetweets.java b/twitter4j-examples/src/main/java/twitter4j/examples/tweets/GetRetweets.java index 3d877ea09..af6d2465d 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/tweets/GetRetweets.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/tweets/GetRetweets.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.tweets; import twitter4j.Status; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/tweets/RetweetStatus.java b/twitter4j-examples/src/main/java/twitter4j/examples/tweets/RetweetStatus.java index db6c103fc..04e8adef3 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/tweets/RetweetStatus.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/tweets/RetweetStatus.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.tweets; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/tweets/ShowStatus.java b/twitter4j-examples/src/main/java/twitter4j/examples/tweets/ShowStatus.java index f74c51003..d41e53819 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/tweets/ShowStatus.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/tweets/ShowStatus.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.tweets; import twitter4j.Status; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/tweets/UpdateStatus.java b/twitter4j-examples/src/main/java/twitter4j/examples/tweets/UpdateStatus.java index cb3004a38..5f6a318b3 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/tweets/UpdateStatus.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/tweets/UpdateStatus.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.tweets; import twitter4j.Status; @@ -90,7 +80,7 @@ public static void main(String[] args) { System.out.println("Access token secret: " + accessToken.getTokenSecret()); } catch (IllegalStateException ie) { // access token is already available, or consumer key/secret is not set. - if(!twitter.getAuthorization().isEnabled()){ + if (!twitter.getAuthorization().isEnabled()) { System.out.println("OAuth consumer key/secret is not set."); System.exit(-1); } diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/user/GetFollowersStatuses.java b/twitter4j-examples/src/main/java/twitter4j/examples/user/GetFollowersStatuses.java index 22ea99e0d..9cd14dbdb 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/user/GetFollowersStatuses.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/user/GetFollowersStatuses.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.user; import twitter4j.PagableResponseList; @@ -53,17 +43,17 @@ public static void main(String[] args) { Twitter twitter = new TwitterFactory().getInstance(); long cursor = -1; PagableResponseList users; - do{ + do { users = twitter.getFollowersStatuses(args[0], cursor); for (User user : users) { - if(null != user.getStatus()){ + if (null != user.getStatus()) { System.out.println("@" + user.getScreenName() + " - " + user.getStatus().getText()); - }else{ + } else { // the user is protected - System.out.println("@"+ user.getScreenName()); + System.out.println("@" + user.getScreenName()); } } - }while((cursor = users.getNextCursor()) != 0); + } while ((cursor = users.getNextCursor()) != 0); System.out.println("done."); System.exit(0); } catch (TwitterException te) { diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/user/GetFriendsStatuses.java b/twitter4j-examples/src/main/java/twitter4j/examples/user/GetFriendsStatuses.java index 0ee8a9332..4ec4fa7cd 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/user/GetFriendsStatuses.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/user/GetFriendsStatuses.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.user; import twitter4j.PagableResponseList; @@ -54,17 +44,17 @@ public static void main(String[] args) { Twitter twitter = new TwitterFactory().getInstance(); long cursor = -1; PagableResponseList users; - do{ + do { users = twitter.getFriendsStatuses(args[0], cursor); for (User user : users) { - if(null != user.getStatus()){ + if (null != user.getStatus()) { System.out.println("@" + user.getScreenName() + " - " + user.getStatus().getText()); - }else{ + } else { // the user is protected - System.out.println("@"+ user.getScreenName()); + System.out.println("@" + user.getScreenName()); } } - }while((cursor = users.getNextCursor()) != 0); + } while ((cursor = users.getNextCursor()) != 0); System.out.println("done."); System.exit(0); } catch (TwitterException te) { diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/user/GetMemberSuggestions.java b/twitter4j-examples/src/main/java/twitter4j/examples/user/GetMemberSuggestions.java index 2ee299343..0c293837d 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/user/GetMemberSuggestions.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/user/GetMemberSuggestions.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.user; import twitter4j.ResponseList; @@ -53,11 +43,11 @@ public static void main(String[] args) { Twitter twitter = new TwitterFactory().getInstance(); ResponseList users = twitter.getMemberSuggestions(args[0]); for (User user : users) { - if(null != user.getStatus()){ + if (null != user.getStatus()) { System.out.println("@" + user.getScreenName() + " - " + user.getStatus().getText()); - }else{ + } else { // the user is protected - System.out.println("@"+ user.getScreenName()); + System.out.println("@" + user.getScreenName()); } } System.out.println("done."); diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/user/GetProfileImage.java b/twitter4j-examples/src/main/java/twitter4j/examples/user/GetProfileImage.java index 41ec101b1..e539269d2 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/user/GetProfileImage.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/user/GetProfileImage.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.user; import twitter4j.ProfileImage; diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/user/GetSuggestedUserCategories.java b/twitter4j-examples/src/main/java/twitter4j/examples/user/GetSuggestedUserCategories.java index 12d7a5119..de7a96bda 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/user/GetSuggestedUserCategories.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/user/GetSuggestedUserCategories.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.user; import twitter4j.Category; @@ -48,7 +38,7 @@ public static void main(String[] args) { Twitter twitter = new TwitterFactory().getInstance(); System.out.println("Showing suggested user categories."); ResponseList categories = twitter.getSuggestedUserCategories(); - for(Category category : categories){ + for (Category category : categories) { System.out.println(category.getName() + ":" + category.getSlug()); } System.out.println("done."); diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/user/GetUserSuggestions.java b/twitter4j-examples/src/main/java/twitter4j/examples/user/GetUserSuggestions.java index c298dd532..899061344 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/user/GetUserSuggestions.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/user/GetUserSuggestions.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.user; import twitter4j.ResponseList; @@ -53,11 +43,11 @@ public static void main(String[] args) { Twitter twitter = new TwitterFactory().getInstance(); ResponseList users = twitter.getUserSuggestions(args[0]); for (User user : users) { - if(null != user.getStatus()){ + if (null != user.getStatus()) { System.out.println("@" + user.getScreenName() + " - " + user.getStatus().getText()); - }else{ + } else { // the user is protected - System.out.println("@"+ user.getScreenName()); + System.out.println("@" + user.getScreenName()); } } System.out.println("done."); diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/user/LookupUsers.java b/twitter4j-examples/src/main/java/twitter4j/examples/user/LookupUsers.java index 64f63778d..5ebd4e4b8 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/user/LookupUsers.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/user/LookupUsers.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.user; import twitter4j.ResponseList; @@ -51,13 +41,13 @@ public static void main(String[] args) { } try { Twitter twitter = new TwitterFactory().getInstance(); - ResponseList users = twitter.lookupUsers(args[0].split(",")); + ResponseList users = twitter.lookupUsers(args[0].split(",")); for (User user : users) { - if(null != user.getStatus()){ + if (null != user.getStatus()) { System.out.println("@" + user.getScreenName() + " - " + user.getStatus().getText()); - }else{ + } else { // the user is protected - System.out.println("@"+ user.getScreenName()); + System.out.println("@" + user.getScreenName()); } } System.out.println("Successfully looked up users [" + args[0] + "]."); diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/user/SearchUsers.java b/twitter4j-examples/src/main/java/twitter4j/examples/user/SearchUsers.java index ba0ea8f90..b791a1d86 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/user/SearchUsers.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/user/SearchUsers.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.user; import twitter4j.ResponseList; @@ -45,14 +35,14 @@ public final class SearchUsers { */ public static void main(String[] args) { if (args.length < 1) { - System.out.println( "Usage: java twitter4j.examples.user.SearchUsers [query]"); + System.out.println("Usage: java twitter4j.examples.user.SearchUsers [query]"); System.exit(-1); } try { Twitter twitter = new TwitterFactory().getInstance(); int page = 1; ResponseList users; - do{ + do { users = twitter.searchUsers(args[0], page); for (User user : users) { if (null != user.getStatus()) { diff --git a/twitter4j-examples/src/main/java/twitter4j/examples/user/ShowUser.java b/twitter4j-examples/src/main/java/twitter4j/examples/user/ShowUser.java index c247eb880..836c4bb74 100644 --- a/twitter4j-examples/src/main/java/twitter4j/examples/user/ShowUser.java +++ b/twitter4j-examples/src/main/java/twitter4j/examples/user/ShowUser.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.examples.user; import twitter4j.Twitter; diff --git a/twitter4j-examples/src/main/resources/META-INF/LICENSE.txt b/twitter4j-examples/src/main/resources/META-INF/LICENSE.txt index cf0d8e0e3..67db85882 100644 --- a/twitter4j-examples/src/main/resources/META-INF/LICENSE.txt +++ b/twitter4j-examples/src/main/resources/META-INF/LICENSE.txt @@ -1,26 +1,175 @@ -Twitter4J includes software from JSON.org to parse JSON response from the Twitter API. You can see the license term at http://www.JSON.org/license.html - -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/twitter4j-httpclient-support/src/main/java/twitter4j/internal/http/alternative/ApacheHttpClientHttpResponseImpl.java b/twitter4j-httpclient-support/src/main/java/twitter4j/internal/http/alternative/ApacheHttpClientHttpResponseImpl.java index 9800bb16a..4ec1c5850 100644 --- a/twitter4j-httpclient-support/src/main/java/twitter4j/internal/http/alternative/ApacheHttpClientHttpResponseImpl.java +++ b/twitter4j-httpclient-support/src/main/java/twitter4j/internal/http/alternative/ApacheHttpClientHttpResponseImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.http.alternative; import org.apache.http.Header; diff --git a/twitter4j-httpclient-support/src/main/java/twitter4j/internal/http/alternative/HttpClientImpl.java b/twitter4j-httpclient-support/src/main/java/twitter4j/internal/http/alternative/HttpClientImpl.java index 9a44080d7..48d0f6b87 100644 --- a/twitter4j-httpclient-support/src/main/java/twitter4j/internal/http/alternative/HttpClientImpl.java +++ b/twitter4j-httpclient-support/src/main/java/twitter4j/internal/http/alternative/HttpClientImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.http.alternative; import org.apache.http.HttpHost; diff --git a/twitter4j-httpclient-support/src/main/java/twitter4j/internal/http/alternative/Version.java b/twitter4j-httpclient-support/src/main/java/twitter4j/internal/http/alternative/Version.java index d4fbdf67e..147393ccb 100644 --- a/twitter4j-httpclient-support/src/main/java/twitter4j/internal/http/alternative/Version.java +++ b/twitter4j-httpclient-support/src/main/java/twitter4j/internal/http/alternative/Version.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.internal.http.alternative; /** diff --git a/twitter4j-httpclient-support/src/main/resources/META-INF/LICENSE.txt b/twitter4j-httpclient-support/src/main/resources/META-INF/LICENSE.txt index cf0d8e0e3..67db85882 100644 --- a/twitter4j-httpclient-support/src/main/resources/META-INF/LICENSE.txt +++ b/twitter4j-httpclient-support/src/main/resources/META-INF/LICENSE.txt @@ -1,26 +1,175 @@ -Twitter4J includes software from JSON.org to parse JSON response from the Twitter API. You can see the license term at http://www.JSON.org/license.html - -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/twitter4j-httpclient-support/src/test/java/twitter4j/ApacheHttpClientTest.java b/twitter4j-httpclient-support/src/test/java/twitter4j/ApacheHttpClientTest.java index 3de4d7d9e..2499bf0b6 100644 --- a/twitter4j-httpclient-support/src/test/java/twitter4j/ApacheHttpClientTest.java +++ b/twitter4j-httpclient-support/src/test/java/twitter4j/ApacheHttpClientTest.java @@ -1,38 +1,24 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j; import junit.framework.TestCase; -import twitter4j.conf.PropertyConfiguration; -import twitter4j.http.AccessToken; import java.io.File; -import java.io.InputStream; -import java.util.Properties; /** @@ -43,6 +29,7 @@ public class ApacheHttpClientTest extends TestCase { public ApacheHttpClientTest(String name) { super(name); } + Twitter twitterAPI1 = null; protected void setUp() throws Exception { @@ -54,12 +41,13 @@ protected void tearDown() throws Exception { super.tearDown(); twitterAPI1.shutdown(); } + public void testOAuth() throws Exception { //get twitterAPI1.verifyCredentials(); //post twitterAPI1.updateStatus(new StatusUpdate(new java.util.Date() + " test")); //multipart-post - twitterAPI1.updateProfileBackgroundImage(new File("src/test/resources/t4j-reverse.gif"),false); + twitterAPI1.updateProfileBackgroundImage(new File("src/test/resources/t4j-reverse.gif"), false); } } diff --git a/twitter4j-media-support/src/main/java/twitter4j/media/AbstractImageUploadImpl.java b/twitter4j-media-support/src/main/java/twitter4j/media/AbstractImageUploadImpl.java index 115d4068f..6e636e763 100644 --- a/twitter4j-media-support/src/main/java/twitter4j/media/AbstractImageUploadImpl.java +++ b/twitter4j-media-support/src/main/java/twitter4j/media/AbstractImageUploadImpl.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.media; import twitter4j.TwitterException; diff --git a/twitter4j-media-support/src/main/java/twitter4j/media/ImageUpload.java b/twitter4j-media-support/src/main/java/twitter4j/media/ImageUpload.java index fde436fa2..02fb34b8f 100644 --- a/twitter4j-media-support/src/main/java/twitter4j/media/ImageUpload.java +++ b/twitter4j-media-support/src/main/java/twitter4j/media/ImageUpload.java @@ -1,36 +1,26 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.media; +import twitter4j.TwitterException; + import java.io.File; import java.io.InputStream; -import twitter4j.TwitterException; - /** * @author Rémy Rakic - remy.rakic at gmail.com * @author Takao Nakaguchi - takao.nakaguchi at gmail.com @@ -39,7 +29,10 @@ */ public interface ImageUpload { public String upload(File image, String message) throws TwitterException; + public String upload(File image) throws TwitterException; + public String upload(String imageFileName, InputStream imageBody) throws TwitterException; + public String upload(String imageFileName, InputStream imageBody, String message) throws TwitterException; } diff --git a/twitter4j-media-support/src/main/java/twitter4j/media/ImageUploadFactory.java b/twitter4j-media-support/src/main/java/twitter4j/media/ImageUploadFactory.java index 3f9f70154..4f1eb3d4c 100644 --- a/twitter4j-media-support/src/main/java/twitter4j/media/ImageUploadFactory.java +++ b/twitter4j-media-support/src/main/java/twitter4j/media/ImageUploadFactory.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.media; import twitter4j.conf.Configuration; diff --git a/twitter4j-media-support/src/main/java/twitter4j/media/ImgLyUpload.java b/twitter4j-media-support/src/main/java/twitter4j/media/ImgLyUpload.java index ddd27134e..803eed516 100644 --- a/twitter4j-media-support/src/main/java/twitter4j/media/ImgLyUpload.java +++ b/twitter4j-media-support/src/main/java/twitter4j/media/ImgLyUpload.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.media; import twitter4j.TwitterException; diff --git a/twitter4j-media-support/src/main/java/twitter4j/media/MediaProvider.java b/twitter4j-media-support/src/main/java/twitter4j/media/MediaProvider.java index 82c62ebf9..0231f74af 100644 --- a/twitter4j-media-support/src/main/java/twitter4j/media/MediaProvider.java +++ b/twitter4j-media-support/src/main/java/twitter4j/media/MediaProvider.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.media; import java.io.ObjectStreamException; @@ -42,11 +32,11 @@ public class MediaProvider implements java.io.Serializable { public static MediaProvider IMG_LY = new MediaProvider("IMG_LY"); public static MediaProvider PLIXI = new MediaProvider("PLIXI"); public static MediaProvider TWIPPLE = new MediaProvider("TWIPPLE"); - public static MediaProvider TWITGOO= new MediaProvider("TWITGOO"); + public static MediaProvider TWITGOO = new MediaProvider("TWITGOO"); public static MediaProvider TWITPIC = new MediaProvider("TWITPIC"); public static MediaProvider YFROG = new MediaProvider("YFROG"); public static MediaProvider MOBYPICTURE = new MediaProvider("MOBYPICTURE"); - public static MediaProvider TWIPL= new MediaProvider("TWIPL"); + public static MediaProvider TWIPL = new MediaProvider("TWIPL"); public static MediaProvider POSTEROUS = new MediaProvider("POSTEROUS"); private final String name; diff --git a/twitter4j-media-support/src/main/java/twitter4j/media/MobypictureUpload.java b/twitter4j-media-support/src/main/java/twitter4j/media/MobypictureUpload.java index 257e5b03c..e1fa9c81f 100644 --- a/twitter4j-media-support/src/main/java/twitter4j/media/MobypictureUpload.java +++ b/twitter4j-media-support/src/main/java/twitter4j/media/MobypictureUpload.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.media; import twitter4j.TwitterException; @@ -34,8 +24,8 @@ import twitter4j.internal.org.json.JSONObject; /** - * @see mobyapi documentation * @author withgod - noname at withgod.jp + * @see mobyapi documentation * @since Twitter4J 2.1.12 */ class MobypictureUpload extends AbstractImageUploadImpl { diff --git a/twitter4j-media-support/src/main/java/twitter4j/media/PlixiUpload.java b/twitter4j-media-support/src/main/java/twitter4j/media/PlixiUpload.java index 37d77690a..48f673b56 100644 --- a/twitter4j-media-support/src/main/java/twitter4j/media/PlixiUpload.java +++ b/twitter4j-media-support/src/main/java/twitter4j/media/PlixiUpload.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.media; import twitter4j.TwitterException; diff --git a/twitter4j-media-support/src/main/java/twitter4j/media/PosterousUpload.java b/twitter4j-media-support/src/main/java/twitter4j/media/PosterousUpload.java index bb0806182..983777054 100644 --- a/twitter4j-media-support/src/main/java/twitter4j/media/PosterousUpload.java +++ b/twitter4j-media-support/src/main/java/twitter4j/media/PosterousUpload.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.media; import twitter4j.TwitterException; @@ -34,8 +24,8 @@ import twitter4j.internal.org.json.JSONObject; /** - * @see Posterous API Documentation * @author withgod - noname at withgod.jp + * @see Posterous API Documentation * @since Twitter4J 2.1.12 */ class PosterousUpload extends AbstractImageUploadImpl { diff --git a/twitter4j-media-support/src/main/java/twitter4j/media/TwiplUpload.java b/twitter4j-media-support/src/main/java/twitter4j/media/TwiplUpload.java index 838eeba6b..7fd6bfca9 100644 --- a/twitter4j-media-support/src/main/java/twitter4j/media/TwiplUpload.java +++ b/twitter4j-media-support/src/main/java/twitter4j/media/TwiplUpload.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.media; import twitter4j.TwitterException; @@ -32,8 +22,8 @@ import twitter4j.internal.http.HttpParameter; /** - * @see Twipl Open API * @author withgod - noname at withgod.jp + * @see Twipl Open API * @since Twitter4J 2.1.12 */ class TwiplUpload extends AbstractImageUploadImpl { @@ -50,23 +40,23 @@ protected String postUpload() throws TwitterException { throw new TwitterException("Twipl image upload returned invalid status code", httpResponse); String response = httpResponse.asString(); - if(-1 != response.indexOf("")){ + if (-1 != response.indexOf("")) { String h = ""; int i = response.indexOf(h); - if(i != -1){ + if (i != -1) { int j = response.indexOf("", i + h.length()); - if(j != -1){ + if (j != -1) { return response.substring(i + h.length(), j); } } - } else if(-1 != response.indexOf("")){ + } else if (-1 != response.indexOf("")) { String h = "msg=\""; int i = response.indexOf(h); - if(i != -1){ + if (i != -1) { int j = response.indexOf("\"", i + h.length()); - if(j != -1){ + if (j != -1) { String msg = response.substring(i + h.length(), j); - throw new TwitterException ("Invalid Twitgoo response: " + msg); + throw new TwitterException("Invalid Twitgoo response: " + msg); } } } @@ -89,7 +79,7 @@ protected void preUpload() throws TwitterException { HttpParameter[] params = { new HttpParameter("key", apiKey), new HttpParameter("media1", fname, this.image.getFileBody()) - }; + }; if (message != null) { params = appendHttpParameters(new HttpParameter[]{ this.message diff --git a/twitter4j-media-support/src/main/java/twitter4j/media/TwippleUpload.java b/twitter4j-media-support/src/main/java/twitter4j/media/TwippleUpload.java index 25870c02a..06f9f776f 100644 --- a/twitter4j-media-support/src/main/java/twitter4j/media/TwippleUpload.java +++ b/twitter4j-media-support/src/main/java/twitter4j/media/TwippleUpload.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.media; import twitter4j.TwitterException; diff --git a/twitter4j-media-support/src/main/java/twitter4j/media/TwitgooUpload.java b/twitter4j-media-support/src/main/java/twitter4j/media/TwitgooUpload.java index 58801ddc6..5f9a9c530 100644 --- a/twitter4j-media-support/src/main/java/twitter4j/media/TwitgooUpload.java +++ b/twitter4j-media-support/src/main/java/twitter4j/media/TwitgooUpload.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.media; import twitter4j.TwitterException; @@ -45,33 +35,33 @@ public TwitgooUpload(Configuration conf, OAuthAuthorization oauth) { @Override protected String postUpload() throws TwitterException { - int statusCode = httpResponse.getStatusCode (); + int statusCode = httpResponse.getStatusCode(); if (statusCode != 200) - throw new TwitterException ("Twitgoo image upload returned invalid status code", httpResponse); - - String response = httpResponse.asString (); - if(-1 != response.indexOf("")){ + throw new TwitterException("Twitgoo image upload returned invalid status code", httpResponse); + + String response = httpResponse.asString(); + if (-1 != response.indexOf("")) { String h = ""; int i = response.indexOf(h); - if(i != -1){ + if (i != -1) { int j = response.indexOf("", i + h.length()); - if(j != -1){ + if (j != -1) { return response.substring(i + h.length(), j); } } - } else if(-1 != response.indexOf("")){ + } else if (-1 != response.indexOf("")) { String h = "msg=\""; int i = response.indexOf(h); - if(i != -1){ + if (i != -1) { int j = response.indexOf("\"", i + h.length()); - if(j != -1){ + if (j != -1) { String msg = response.substring(i + h.length(), j); - throw new TwitterException ("Invalid Twitgoo response: " + msg); + throw new TwitterException("Invalid Twitgoo response: " + msg); } } } - - throw new TwitterException ("Unknown Twitgoo response", httpResponse); + + throw new TwitterException("Unknown Twitgoo response", httpResponse); } @Override diff --git a/twitter4j-media-support/src/main/java/twitter4j/media/TwitpicUpload.java b/twitter4j-media-support/src/main/java/twitter4j/media/TwitpicUpload.java index 564a319c3..e673ebd34 100644 --- a/twitter4j-media-support/src/main/java/twitter4j/media/TwitpicUpload.java +++ b/twitter4j-media-support/src/main/java/twitter4j/media/TwitpicUpload.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.media; import twitter4j.TwitterException; diff --git a/twitter4j-media-support/src/main/java/twitter4j/media/Version.java b/twitter4j-media-support/src/main/java/twitter4j/media/Version.java index 837cebcd1..4d7a3435e 100644 --- a/twitter4j-media-support/src/main/java/twitter4j/media/Version.java +++ b/twitter4j-media-support/src/main/java/twitter4j/media/Version.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.media; /** diff --git a/twitter4j-media-support/src/main/java/twitter4j/media/YFrogUpload.java b/twitter4j-media-support/src/main/java/twitter4j/media/YFrogUpload.java index a074fbbe0..bc336b824 100644 --- a/twitter4j-media-support/src/main/java/twitter4j/media/YFrogUpload.java +++ b/twitter4j-media-support/src/main/java/twitter4j/media/YFrogUpload.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * 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. + */ -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ package twitter4j.media; import twitter4j.Twitter; diff --git a/twitter4j-media-support/src/main/resources/META-INF/LICENSE.txt b/twitter4j-media-support/src/main/resources/META-INF/LICENSE.txt index cf0d8e0e3..67db85882 100644 --- a/twitter4j-media-support/src/main/resources/META-INF/LICENSE.txt +++ b/twitter4j-media-support/src/main/resources/META-INF/LICENSE.txt @@ -1,26 +1,175 @@ -Twitter4J includes software from JSON.org to parse JSON response from the Twitter API. You can see the license term at http://www.JSON.org/license.html - -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/twitter4j-media-support/src/test/java/twitter4j/media/MediaUploadTest.java b/twitter4j-media-support/src/test/java/twitter4j/media/MediaUploadTest.java index 11e555922..00816dbd4 100644 --- a/twitter4j-media-support/src/test/java/twitter4j/media/MediaUploadTest.java +++ b/twitter4j-media-support/src/test/java/twitter4j/media/MediaUploadTest.java @@ -1,29 +1,19 @@ /* -Copyright (c) 2007-2011, Yusuke Yamamoto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Yusuke Yamamoto nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + * 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.media; import junit.framework.TestCase;