From 3b5fbe265264fa1b6649d80f8afd073a5e843b89 Mon Sep 17 00:00:00 2001 From: Vincent Privat Date: Sun, 19 Apr 2020 14:25:26 +0200 Subject: [PATCH 1/3] Update dependencies, fix javadoc errors, OAuth refactor --- pom.xml | 20 +-- .../java/com/flickr4java/flickr/Flickr.java | 2 +- .../java/com/flickr4java/flickr/REST.java | 99 +++------------ .../com/flickr4java/flickr/Transport.java | 2 +- .../flickr4java/flickr/contacts/Contact.java | 2 +- .../flickr/contacts/ContactsInterface.java | 2 +- .../flickr/favorites/FavoritesInterface.java | 8 +- .../flickr/galleries/GalleriesInterface.java | 2 +- .../groups/discuss/GroupDiscussInterface.java | 2 +- .../machinetags/MachinetagsInterface.java | 22 ++-- .../com/flickr4java/flickr/people/User.java | 2 +- .../flickr/photos/PhotosInterface.java | 4 +- .../flickr/photos/SearchParameters.java | 16 ++- .../flickr/photosets/PhotosetsInterface.java | 2 +- .../flickr/places/PlacesInterface.java | 2 +- .../flickr/tags/TagsInterface.java | 1 - .../flickr/util/OAuthUtilities.java | 114 ++++++++++++++++++ .../flickr/test/CamerasInterfaceTest.java | 4 +- .../flickr/test/CommentsInterfaceTest.java | 1 - .../flickr/test/FavoritesInterfaceTest.java | 1 - .../test/InterestingnessInterfaceTest.java | 1 - .../flickr/test/OAuthUtilitiesTest.java | 73 +++++++++++ .../flickr/test/PhotosInterfaceTest.java | 1 - .../flickr/test/util/FileTestProperties.java | 7 -- .../flickr/test/util/TransportStub.java | 5 - 25 files changed, 246 insertions(+), 149 deletions(-) create mode 100644 src/main/java/com/flickr4java/flickr/util/OAuthUtilities.java create mode 100644 src/test/java/com/flickr4java/flickr/test/OAuthUtilitiesTest.java diff --git a/pom.xml b/pom.xml index 87bf1756..c72ca81d 100644 --- a/pom.xml +++ b/pom.xml @@ -35,9 +35,9 @@ 1.8 - 4.11 - 1.7.25 - 6.2.0 + 4.13 + 1.7.30 + 6.9.0 @@ -71,7 +71,7 @@ org.apache.maven.plugins maven-release-plugin - 2.1 + 2.5.3 forked-path false @@ -85,7 +85,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.8.1 ${javaVersion} ${javaVersion} @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.19.1 + 2.22.2 ${setupPropertiesPath} @@ -104,7 +104,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.2.1 attach-sources @@ -118,7 +118,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.9.1 + 3.2.0 attach-javadocs @@ -202,7 +202,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.1 + 1.6 sign-artifacts @@ -222,7 +222,7 @@ org.apache.maven.plugins maven-surefire-report-plugin - 2.20.1 + 2.22.2 diff --git a/src/main/java/com/flickr4java/flickr/Flickr.java b/src/main/java/com/flickr4java/flickr/Flickr.java index ad4c2a17..7d06f5cd 100644 --- a/src/main/java/com/flickr4java/flickr/Flickr.java +++ b/src/main/java/com/flickr4java/flickr/Flickr.java @@ -49,7 +49,7 @@ *

* * The user who authenticates himself, can manage this permissions at his list of Third-party - * applications (You -> Your account -> Extending Flickr -> Account Links -> edit). + * applications (You / Your account / Extending Flickr / Account Links / edit). * * @author Anthony Eden * @version $Id: Flickr.java,v 1.45 2009/06/23 21:51:25 x-mago Exp $ diff --git a/src/main/java/com/flickr4java/flickr/REST.java b/src/main/java/com/flickr4java/flickr/REST.java index 241e2960..1e32cd71 100644 --- a/src/main/java/com/flickr4java/flickr/REST.java +++ b/src/main/java/com/flickr4java/flickr/REST.java @@ -6,10 +6,8 @@ import com.flickr4java.flickr.uploader.UploadMetaData; import com.flickr4java.flickr.util.DebugInputStream; import com.flickr4java.flickr.util.IOUtilities; +import com.flickr4java.flickr.util.OAuthUtilities; import com.flickr4java.flickr.util.UrlUtilities; -import com.github.scribejava.apis.FlickrApi; -import com.github.scribejava.core.builder.ServiceBuilder; -import com.github.scribejava.core.httpclient.jdk.JDKHttpClientConfig; import com.github.scribejava.core.model.OAuth1AccessToken; import com.github.scribejava.core.model.OAuthRequest; import com.github.scribejava.core.model.Verb; @@ -31,7 +29,6 @@ import java.util.Base64; import java.util.HashMap; import java.util.Map; -import java.util.UUID; import java.util.concurrent.ExecutionException; /** @@ -144,7 +141,7 @@ public com.flickr4java.flickr.Response get(String path, Map para RequestContext requestContext = RequestContext.getRequestContext(); Auth auth = requestContext.getAuth(); - OAuth10aService service = createOAuthService(apiKey, sharedSecret); + OAuth10aService service = OAuthUtilities.createOAuthService(apiKey, sharedSecret, connectTimeoutMs, readTimeoutMs); if (auth != null) { OAuth1AccessToken requestToken = new OAuth1AccessToken(auth.getToken(), auth.getTokenSecret()); service.signRequest(requestToken, request); @@ -162,7 +159,7 @@ public com.flickr4java.flickr.Response get(String path, Map para try { return handleResponse(request, service); - } catch (IllegalAccessException | InstantiationException | SAXException | IOException | InterruptedException | ExecutionException | ParserConfigurationException e) { + } catch (ReflectiveOperationException | SAXException | IOException | InterruptedException | ExecutionException | ParserConfigurationException e) { throw new FlickrRuntimeException(e); } } @@ -177,15 +174,13 @@ public com.flickr4java.flickr.Response get(String path, Map para @Override public com.flickr4java.flickr.Response post(String path, Map parameters, String apiKey, String sharedSecret) throws FlickrException { - OAuthRequest request = new OAuthRequest(Verb.POST, buildUrl(path)); - - buildNormalPostRequest(parameters, request); + OAuthRequest request = OAuthUtilities.buildNormalPostRequest(parameters, buildUrl(path)); OAuth10aService service = createAndSignRequest(apiKey, sharedSecret, request); try { return handleResponse(request, service); - } catch (IllegalAccessException | InterruptedException | ExecutionException | InstantiationException | IOException | SAXException | ParserConfigurationException e) { + } catch (ReflectiveOperationException | InterruptedException | ExecutionException | IOException | SAXException | ParserConfigurationException e) { throw new FlickrRuntimeException(e); } } @@ -201,58 +196,41 @@ public com.flickr4java.flickr.Response post(String path, Map par @Override public com.flickr4java.flickr.Response postMultiPart(String path, UploadMetaData metaData, Payload payload, String apiKey, String sharedSecret) throws FlickrException { - OAuthRequest request = new OAuthRequest(Verb.POST, buildUrl(path)); Map uploadParameters = new HashMap<>(metaData.getUploadParameters()); - - buildMultipartRequest(uploadParameters, request); + OAuthRequest request = OAuthUtilities.buildMultipartRequest(uploadParameters, buildUrl(path)); OAuth10aService service = createAndSignRequest(apiKey, sharedSecret, request); // Ensure all parameters (including oauth) are added to payload so signature matches uploadParameters.putAll(request.getOauthParameters()); - request.addMultipartPayload(String.format("form-data; name=\"photo\"; filename=\"%s\"", metaData.getFilename()), metaData.getFilemimetype(), payload.getPayload()); + request.addFileByteArrayBodyPartPayloadInMultipartPayload(metaData.getFilemimetype(), payload.getPayload()); uploadParameters.entrySet().forEach(e -> - request.addMultipartPayload(String.format("form-data; name=\"%s\"", e.getKey()), null, e.getValue().getBytes())); + request.addFileByteArrayBodyPartPayloadInMultipartPayload(null, e.getValue().getBytes())); try { return handleResponse(request, service); - } catch (IllegalAccessException | InterruptedException | ExecutionException | InstantiationException | IOException | SAXException | ParserConfigurationException e) { + } catch (ReflectiveOperationException | InterruptedException | ExecutionException | IOException | SAXException | ParserConfigurationException e) { throw new FlickrRuntimeException(e); } } private OAuth10aService createAndSignRequest(String apiKey, String sharedSecret, OAuthRequest request) { - RequestContext requestContext = RequestContext.getRequestContext(); - Auth auth = requestContext.getAuth(); - OAuth10aService service = createOAuthService(apiKey, sharedSecret); - if (auth != null) { - OAuth1AccessToken requestToken = new OAuth1AccessToken(auth.getToken(), auth.getTokenSecret()); - service.signRequest(requestToken, request); - } - - if (proxyAuth) { - request.addHeader("Proxy-Authorization", "Basic " + getProxyCredentials()); - } - - if (Flickr.debugRequest) { - logger.debug("POST: " + request.getCompleteUrl()); - } - - return service; + OAuth10aService service = OAuthUtilities.createOAuthService(apiKey, sharedSecret, connectTimeoutMs, readTimeoutMs); + OAuthUtilities.signRequest(service, request, proxyAuth ? getProxyCredentials() : null); + return service; } private String buildUrl(String path) { return String.format("%s://%s%s", getScheme(), getHost(), path); } - private Response handleResponse(OAuthRequest request, OAuth10aService service) throws InterruptedException, ExecutionException, IOException, SAXException, InstantiationException, IllegalAccessException, ParserConfigurationException, FlickrException { + private Response handleResponse(OAuthRequest request, OAuth10aService service) throws InterruptedException, ExecutionException, IOException, SAXException, ParserConfigurationException, FlickrException, ReflectiveOperationException { com.github.scribejava.core.model.Response scribeResponse = service.execute(request); if (!scribeResponse.isSuccessful()) { throw new FlickrException(FLICKR_SERVICE_UNAVAILABLE, String.format("Received '%s' error from Flickr with status %d", scribeResponse.getMessage(), scribeResponse.getCode())); } - Response f4jResponse; String strXml = scribeResponse.getBody().trim(); if (Flickr.debugStream) { logger.debug(strXml); @@ -263,7 +241,7 @@ private Response handleResponse(OAuthRequest request, OAuth10aService service) t DocumentBuilder builder = getDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(strXml))); - f4jResponse = (Response) responseClass.newInstance(); + Response f4jResponse = (Response) responseClass.getConstructor().newInstance(); f4jResponse.parse(document); return f4jResponse; @@ -314,55 +292,6 @@ public Response getNonOAuth(String path, Map parameters) { } } - /** - * @param sharedSecret - * @return - */ - private OAuth10aService createOAuthService(String apiKey, String sharedSecret) { - JDKHttpClientConfig config = JDKHttpClientConfig.defaultConfig(); - if (connectTimeoutMs != null) { - config.setConnectTimeout(connectTimeoutMs); - } - if (readTimeoutMs != null) { - config.setReadTimeout(readTimeoutMs); - } - ServiceBuilder serviceBuilder = new ServiceBuilder(apiKey).apiKey(apiKey).apiSecret(sharedSecret).httpClientConfig(config); - - if (Flickr.debugRequest) { - serviceBuilder = serviceBuilder.debug(); - } - - return serviceBuilder.build(FlickrApi.instance()); - } - - /** - * @param parameters - * @param request - */ - private void buildNormalPostRequest(Map parameters, OAuthRequest request) { - for (Map.Entry entry : parameters.entrySet()) { - request.addBodyParameter(entry.getKey(), String.valueOf(entry.getValue())); - } - } - - /** - * @param parameters - * @param request - */ - private void buildMultipartRequest(Map parameters, OAuthRequest request) { - String multipartBoundary = getMultipartBoundary(); - request.initMultipartBoundary(multipartBoundary); - - request.addHeader("Content-Type", "multipart/form-data; boundary=" + multipartBoundary); - for (Map.Entry entry : parameters.entrySet()) { - request.addQuerystringParameter(entry.getKey(), entry.getValue()); - } - } - - private String getMultipartBoundary() { - return "---------------------------" + UUID.randomUUID(); - } - public boolean isProxyAuth() { return proxyAuth; } diff --git a/src/main/java/com/flickr4java/flickr/Transport.java b/src/main/java/com/flickr4java/flickr/Transport.java index f26e881f..a0e7a7a9 100644 --- a/src/main/java/com/flickr4java/flickr/Transport.java +++ b/src/main/java/com/flickr4java/flickr/Transport.java @@ -132,7 +132,7 @@ public void setScheme(String scheme) { * @param parameters * The parameters * @return The Response - * @throws FlickrException + * @throws FlickrRuntimeException */ public abstract Response getNonOAuth(String path, Map parameters) throws FlickrRuntimeException; diff --git a/src/main/java/com/flickr4java/flickr/contacts/Contact.java b/src/main/java/com/flickr4java/flickr/contacts/Contact.java index d73fe40f..d8545116 100644 --- a/src/main/java/com/flickr4java/flickr/contacts/Contact.java +++ b/src/main/java/com/flickr4java/flickr/contacts/Contact.java @@ -159,7 +159,7 @@ public void setIconServer(String iconServer) { /** * Get the contact's path alias, which may appear instead of nsid in urls published by Flickr. For example feeds have urls of the form - * .../photos/${NSID_OR_PATHALIAS}/${PHOTO_ID} & .../people/${NSID_OR_PATHALIAS}. This allows clients to look up a {@link Contact} given such a url. (Note + * .../photos/${NSID_OR_PATHALIAS}/${PHOTO_ID} and .../people/${NSID_OR_PATHALIAS}. This allows clients to look up a {@link Contact} given such a url. (Note * that <author> elements in feeds have a <flickr:nsid> child which could be used instead of the lookup this method * enables.) * diff --git a/src/main/java/com/flickr4java/flickr/contacts/ContactsInterface.java b/src/main/java/com/flickr4java/flickr/contacts/ContactsInterface.java index 1e93346a..d8e66d25 100644 --- a/src/main/java/com/flickr4java/flickr/contacts/ContactsInterface.java +++ b/src/main/java/com/flickr4java/flickr/contacts/ContactsInterface.java @@ -94,7 +94,7 @@ public Collection getList() throws FlickrException { * Limits the resultset to contacts that have uploaded photos since this date. The date should be in the form of a Unix timestamp. The default, * and maximum, offset is (1) hour. (Optional, can be null) * @param filter - * Limit the result set to all contacts or only those who are friends or family.
+ * Limit the result set to all contacts or only those who are friends or family.
* Valid options are: ff -> friends and family, all -> all your contacts. (Optional, can be null) * * @return List of Contacts diff --git a/src/main/java/com/flickr4java/flickr/favorites/FavoritesInterface.java b/src/main/java/com/flickr4java/flickr/favorites/FavoritesInterface.java index 8ea40e46..6b04ed8e 100644 --- a/src/main/java/com/flickr4java/flickr/favorites/FavoritesInterface.java +++ b/src/main/java/com/flickr4java/flickr/favorites/FavoritesInterface.java @@ -75,9 +75,9 @@ public void add(String photoId) throws FlickrException { * @param userId * The optional user ID. Null value will be ignored. * @param perPage - * The optional per page value. Values <= 0 will be ignored. + * The optional per page value. Values {@code <= 0} will be ignored. * @param page - * The page to view. Values <= 0 will be ignored. + * The page to view. Values {@code <= 0} will be ignored. * @param extras * a Set Strings representing extra parameters to send * @return The Collection of Photo objects @@ -128,9 +128,9 @@ public PhotoList getList(String userId, int perPage, int page, Setflickr.galleries.getList + * @see flickr.galleries.getList */ public List getList(String userId, int perPage, int page) throws FlickrException { Map parameters = new HashMap(); diff --git a/src/main/java/com/flickr4java/flickr/groups/discuss/GroupDiscussInterface.java b/src/main/java/com/flickr4java/flickr/groups/discuss/GroupDiscussInterface.java index a491ecd0..319ab155 100644 --- a/src/main/java/com/flickr4java/flickr/groups/discuss/GroupDiscussInterface.java +++ b/src/main/java/com/flickr4java/flickr/groups/discuss/GroupDiscussInterface.java @@ -42,7 +42,7 @@ public GroupDiscussInterface(String apiKey, String sharedSecret, Transport trans * Get a list of topics from a group. * * @param groupId - * Unique identifier of a group returns a list of topics for a given group {@link Group}. + * Unique identifier of a group returns a list of topics for a given group {@link com.flickr4java.flickr.groups.Group}. * @param perPage * Number of records per page. * @param page diff --git a/src/main/java/com/flickr4java/flickr/machinetags/MachinetagsInterface.java b/src/main/java/com/flickr4java/flickr/machinetags/MachinetagsInterface.java index 76b83156..b1a21f1f 100644 --- a/src/main/java/com/flickr4java/flickr/machinetags/MachinetagsInterface.java +++ b/src/main/java/com/flickr4java/flickr/machinetags/MachinetagsInterface.java @@ -43,18 +43,18 @@ * is the excellent "Flickr Upcoming Event" greasemonkey script: *

* - * {@link http://userscripts.org/scripts/show/5464} + * Flickr Upcoming Event *

* * Dan Catt wrote a very good piece about machine tags - he called them "triple tags" - last year: *

* - * {@link http://geobloggers.com/archives/2006/01/11/advanced-tagging-and-tripletags/} + * Advanced Tagging and TripleTags *

* * Update : Dan's gone and written another excellent piece about all of this stuff now that we've launched machine tags: * - * {@link http://geobloggers.com/archives/2007/01/24/offtopic-ish-flickr-ramps-up-triple-tag-support/} + * Flickr Ramps up Triple Tag (Machine Tags) Support * * *

@@ -130,37 +130,37 @@ *

  • Find photos using the 'dc' namespace: *

    * - * {"machine_tags" => "dc:"}

  • + * {"machine_tags" => "dc:"} * *
  • Find photos with a title in the 'dc' namespace: *

    * - * {"machine_tags" => "dc:title="}

  • + * {"machine_tags" => "dc:title="} * *
  • Find photos titled "mr. camera" in the 'dc' namespace: *

    * - * {"machine_tags" => "dc:title=\"mr. camera\"}

  • + * {"machine_tags" => "dc:title=\"mr. camera\"} * *
  • Find photos whose value is "mr. camera": *

    * - * {"machine_tags" => "*:*=\"mr. camera\""}

  • + * {"machine_tags" => "*:*=\"mr. camera\""} * *
  • Find photos that have a title, in any namespace: *

    * - * {"machine_tags" => "*:title="}

  • + * {"machine_tags" => "*:title="} * *
  • Find photos that have a title, in any namespace, whose value is "mr. camera": *

    * - * {"machine_tags" => "*:title=\"mr. camera\""}

  • + * {"machine_tags" => "*:title=\"mr. camera\""} * *
  • Find photos, in the 'dc' namespace whose value is "mr. camera": *

    * - * {"machine_tags" => "dc:*=\"mr. camera\""}

  • + * {"machine_tags" => "dc:*=\"mr. camera\""} * * *

    Is there a limit to the number of machine tags I can query?

    @@ -215,7 +215,7 @@ * * See also: * - * {@link http://weblog.scifihifi.com/2005/08/05/meta-tags-the-poor-mans-rdf} + * Meta Tags: The Poor Man’s RDF? * *

    Huh, what is RDF?

    * diff --git a/src/main/java/com/flickr4java/flickr/people/User.java b/src/main/java/com/flickr4java/flickr/people/User.java index aaf3fbfb..02cb8326 100644 --- a/src/main/java/com/flickr4java/flickr/people/User.java +++ b/src/main/java/com/flickr4java/flickr/people/User.java @@ -516,7 +516,7 @@ public boolean isRevFamily() { /** * Get the user's path alias, which may appear instead of nsid in urls published by Flickr. For example feeds have urls of the form - * .../photos/${NSID_OR_PATHALIAS}/${PHOTO_ID} & .../people/${NSID_OR_PATHALIAS}. This allows clients to look up a {@link User} given such a url. (Note that + * .../photos/${NSID_OR_PATHALIAS}/${PHOTO_ID} and .../people/${NSID_OR_PATHALIAS}. This allows clients to look up a {@link User} given such a url. (Note that * <author> elements in feeds have a <flickr:nsid> child which could be used instead of the lookup this method * enables.) * diff --git a/src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java b/src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java index e21bac88..a8cff448 100644 --- a/src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java +++ b/src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java @@ -809,7 +809,7 @@ public PhotoList getUntagged(int perPage, int page) throws FlickrExceptio *
  • 1 public photos
  • *
  • 2 private photos visible to friends
  • *
  • 3 private photos visible to family
  • - *
  • 4 private photos visible to friends & family
  • + *
  • 4 private photos visible to friends and family
  • *
  • 5 completely private photos
  • * * Set to 0 to not specify a privacy Filter. @@ -889,7 +889,7 @@ public PhotoList getWithGeoData(Date minUploadDate, Date maxUploadDate, D *
  • 1 public photos
  • *
  • 2 private photos visible to friends
  • *
  • 3 private photos visible to family
  • - *
  • 4 private photos visible to friends & family
  • + *
  • 4 private photos visible to friends and family
  • *
  • 5 completely private photos
  • * * Set to 0 to not specify a privacy Filter. diff --git a/src/main/java/com/flickr4java/flickr/photos/SearchParameters.java b/src/main/java/com/flickr4java/flickr/photos/SearchParameters.java index c1e37217..0b5c850a 100644 --- a/src/main/java/com/flickr4java/flickr/photos/SearchParameters.java +++ b/src/main/java/com/flickr4java/flickr/photos/SearchParameters.java @@ -155,7 +155,7 @@ public int getPrivacyFilter() { *
  • 1 public photos *
  • 2 private photos visible to friends *
  • 3 private photos visible to family - *
  • 4 private photos visible to friends & family + *
  • 4 private photos visible to friends and family *
  • 5 completely private photos * */ @@ -184,7 +184,7 @@ public void setGroupId(String groupId) { * "parameterless searches" for queries without a geo component. *

    * - * A tag, for instance, is considered a limiting agent as are user defined min_date_taken and min_date_upload parameters &emdash; If no limiting factor is + * A tag, for instance, is considered a limiting agent as are user defined min_date_taken and min_date_upload parameters — If no limiting factor is * passed flickr will return only photos added in the last 12 hours (though flickr may extend the limit in the future). * * @param hasGeo @@ -394,7 +394,6 @@ public void setSort(int order) { * @return A placeId * @see com.flickr4java.flickr.places.PlacesInterface#resolvePlaceId(String) */ - @SuppressWarnings("javadoc") public String getPlaceId() { return placeId; } @@ -406,7 +405,7 @@ public String getPlaceId() { * "parameterless searches" for queries without a geo component. *

    * - * A tag, for instance, is considered a limiting agent as are user defined min_date_taken and min_date_upload parameters &emdash; If no limiting factor is + * A tag, for instance, is considered a limiting agent as are user defined min_date_taken and min_date_upload parameters — If no limiting factor is * passed we return only photos added in the last 12 hours (though we may extend the limit in the future). * * @param placeId @@ -414,7 +413,6 @@ public String getPlaceId() { * @see com.flickr4java.flickr.places.Place#getPlaceId() * @see com.flickr4java.flickr.places.Location#getPlaceId() */ - @SuppressWarnings("javadoc") public void setPlaceId(String placeId) { this.placeId = placeId; } @@ -427,15 +425,15 @@ public String getWoeId() { * A Where on Earth identifier to use to filter photo clusters.
    * For example all the photos clustered by locality in the United States (WOE ID 23424977).
    * (not used if bbox argument is present). - *

    + *

    * * Geo queries require some sort of limiting agent in order to prevent the database from crying. This is basically like the check against * "parameterless searches" for queries without a geo component. - *

    + *

    * * A tag, for instance, is considered a limiting agent as are user defined min_date_taken and min_date_upload parameters. If no limiting factor is passed we * return only photos added in the last 12 hours (though flickr may extend the limit in the future). - *

    + *

    * * @param woeId * @see com.flickr4java.flickr.places.Place#getWoeId() @@ -468,7 +466,7 @@ public String getContacts() { /** * Search your contacts. Valid arguments are either 'all' or 'ff' for just friends and family. - *

    + *

    * * It requires that the "user_id" field also be set and allows you to limit queries to only photos belonging to that user's photos. As in : All my contacts * photos tagged "aaron". (Experimental) diff --git a/src/main/java/com/flickr4java/flickr/photosets/PhotosetsInterface.java b/src/main/java/com/flickr4java/flickr/photosets/PhotosetsInterface.java index d8cb62ef..5a4ea41f 100644 --- a/src/main/java/com/flickr4java/flickr/photosets/PhotosetsInterface.java +++ b/src/main/java/com/flickr4java/flickr/photosets/PhotosetsInterface.java @@ -77,7 +77,7 @@ public PhotosetsInterface(String apiKey, String sharedSecret, Transport transpor /** * Add a photo to the end of the photoset. - *

    + *

    * Note: requires authentication with the new authentication API with 'write' permission. * * @param photosetId diff --git a/src/main/java/com/flickr4java/flickr/places/PlacesInterface.java b/src/main/java/com/flickr4java/flickr/places/PlacesInterface.java index 719ecfec..75789069 100644 --- a/src/main/java/com/flickr4java/flickr/places/PlacesInterface.java +++ b/src/main/java/com/flickr4java/flickr/places/PlacesInterface.java @@ -25,7 +25,7 @@ *

    * *

    - * From: kellan 
    + * From: kellan - kellan@yahoo-inc.com
      * Date: Fri, 11 Jan 2008 15:57:59 -0800
      * Subject: [yws-flickr] Flickr and "Place IDs"
      * 
    diff --git a/src/main/java/com/flickr4java/flickr/tags/TagsInterface.java b/src/main/java/com/flickr4java/flickr/tags/TagsInterface.java
    index 20916600..6be21e2f 100644
    --- a/src/main/java/com/flickr4java/flickr/tags/TagsInterface.java
    +++ b/src/main/java/com/flickr4java/flickr/tags/TagsInterface.java
    @@ -70,7 +70,6 @@ public TagsInterface(String apiKey, String sharedSecret, Transport transportAPI)
     
         /**
          * Search for tag-clusters.
    -     * 

    * *

    * This method does not require authentication. diff --git a/src/main/java/com/flickr4java/flickr/util/OAuthUtilities.java b/src/main/java/com/flickr4java/flickr/util/OAuthUtilities.java new file mode 100644 index 00000000..08121597 --- /dev/null +++ b/src/main/java/com/flickr4java/flickr/util/OAuthUtilities.java @@ -0,0 +1,114 @@ +package com.flickr4java.flickr.util; + +import java.util.Map; +import java.util.UUID; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.flickr4java.flickr.Flickr; +import com.flickr4java.flickr.RequestContext; +import com.flickr4java.flickr.auth.Auth; +import com.github.scribejava.apis.FlickrApi; +import com.github.scribejava.core.builder.ServiceBuilder; +import com.github.scribejava.core.httpclient.jdk.JDKHttpClientConfig; +import com.github.scribejava.core.model.OAuth1AccessToken; +import com.github.scribejava.core.model.OAuthRequest; +import com.github.scribejava.core.model.Verb; +import com.github.scribejava.core.oauth.OAuth10aService; + +/** + * OAuth utilities. + * + * @author Vincent Privat + */ +public final class OAuthUtilities { + + private static final Logger logger = LoggerFactory.getLogger(OAuthUtilities.class); + + private OAuthUtilities() { + + } + + /** + * Creates a new OAuth 1.0.a service. + * + * @param apiKey OAuth API key + * @param sharedSecret OAuth API secret + * @param connectTimeoutMs connect timeout in milliseconds + * @param readTimeoutMs read timeout in milliseconds + * + * @return OAuth 1.0.a service + */ + public static OAuth10aService createOAuthService(String apiKey, String sharedSecret, Integer connectTimeoutMs, Integer readTimeoutMs) { + JDKHttpClientConfig config = JDKHttpClientConfig.defaultConfig(); + if (connectTimeoutMs != null) { + config.setConnectTimeout(connectTimeoutMs); + } + if (readTimeoutMs != null) { + config.setReadTimeout(readTimeoutMs); + } + ServiceBuilder serviceBuilder = new ServiceBuilder(apiKey).apiSecret(sharedSecret).httpClientConfig(config); + + if (Flickr.debugRequest) { + serviceBuilder = serviceBuilder.debug(); + } + + return serviceBuilder.build(FlickrApi.instance()); + } + + /** + * Signs the given OAuth request using the given OAuth service. + * + * @param service OAuth 1.0.a service + * @param request OAuth request + * @param proxyCredentials optional proxy credentials, can be null + */ + public static void signRequest(OAuth10aService service, OAuthRequest request, String proxyCredentials) { + Auth auth = RequestContext.getRequestContext().getAuth(); + if (auth != null) { + service.signRequest(new OAuth1AccessToken(auth.getToken(), auth.getTokenSecret()), request); + } + + if (proxyCredentials != null) { + request.addHeader("Proxy-Authorization", "Basic " + proxyCredentials); + } + + if (Flickr.debugRequest) { + logger.debug("POST: {}", request.getCompleteUrl()); + } + } + + /** + * Builds a normal POST request. + * + * @param parameters body parameters + * @param url URL + * @return OAuth request + */ + public static OAuthRequest buildNormalPostRequest(Map parameters, String url) { + OAuthRequest request = new OAuthRequest(Verb.POST, url); + parameters.entrySet().forEach(e -> request.addBodyParameter(e.getKey(), String.valueOf(e.getValue()))); + return request; + } + + /** + * Builds a multipart POST request. + * + * @param parameters QueryString parameters + * @param url URL + * @return OAuth request + */ + public static OAuthRequest buildMultipartRequest(Map parameters, String url) { + OAuthRequest request = new OAuthRequest(Verb.POST, url); + String multipartBoundary = getMultipartBoundary(); + request.initMultipartPayload(multipartBoundary); + request.addHeader("Content-Type", "multipart/form-data; boundary=" + multipartBoundary); + parameters.entrySet().forEach(e -> request.addQuerystringParameter(e.getKey(), e.getValue())); + return request; + } + + private static String getMultipartBoundary() { + return "---------------------------" + UUID.randomUUID(); + } +} diff --git a/src/test/java/com/flickr4java/flickr/test/CamerasInterfaceTest.java b/src/test/java/com/flickr4java/flickr/test/CamerasInterfaceTest.java index 864b81af..dd8324e4 100644 --- a/src/test/java/com/flickr4java/flickr/test/CamerasInterfaceTest.java +++ b/src/test/java/com/flickr4java/flickr/test/CamerasInterfaceTest.java @@ -1,7 +1,7 @@ package com.flickr4java.flickr.test; -import static junit.framework.Assert.assertNotNull; -import static junit.framework.Assert.assertTrue; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import com.flickr4java.flickr.Flickr; import com.flickr4java.flickr.FlickrException; diff --git a/src/test/java/com/flickr4java/flickr/test/CommentsInterfaceTest.java b/src/test/java/com/flickr4java/flickr/test/CommentsInterfaceTest.java index a72fa253..7d08f0c5 100644 --- a/src/test/java/com/flickr4java/flickr/test/CommentsInterfaceTest.java +++ b/src/test/java/com/flickr4java/flickr/test/CommentsInterfaceTest.java @@ -1,6 +1,5 @@ package com.flickr4java.flickr.test; -import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; diff --git a/src/test/java/com/flickr4java/flickr/test/FavoritesInterfaceTest.java b/src/test/java/com/flickr4java/flickr/test/FavoritesInterfaceTest.java index 6a1880b7..7b391188 100644 --- a/src/test/java/com/flickr4java/flickr/test/FavoritesInterfaceTest.java +++ b/src/test/java/com/flickr4java/flickr/test/FavoritesInterfaceTest.java @@ -16,7 +16,6 @@ import org.junit.Test; import java.util.Collection; -import java.util.Iterator; /** * @author Anthony Eden diff --git a/src/test/java/com/flickr4java/flickr/test/InterestingnessInterfaceTest.java b/src/test/java/com/flickr4java/flickr/test/InterestingnessInterfaceTest.java index ad6dd059..aeffdcd5 100644 --- a/src/test/java/com/flickr4java/flickr/test/InterestingnessInterfaceTest.java +++ b/src/test/java/com/flickr4java/flickr/test/InterestingnessInterfaceTest.java @@ -3,7 +3,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; import com.flickr4java.flickr.FlickrException; import com.flickr4java.flickr.interestingness.InterestingnessInterface; diff --git a/src/test/java/com/flickr4java/flickr/test/OAuthUtilitiesTest.java b/src/test/java/com/flickr4java/flickr/test/OAuthUtilitiesTest.java new file mode 100644 index 00000000..ce90bcc0 --- /dev/null +++ b/src/test/java/com/flickr4java/flickr/test/OAuthUtilitiesTest.java @@ -0,0 +1,73 @@ +package com.flickr4java.flickr.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.junit.Test; + +import com.flickr4java.flickr.util.OAuthUtilities; +import com.github.scribejava.apis.FlickrApi; +import com.github.scribejava.core.builder.ServiceBuilder; +import com.github.scribejava.core.model.OAuthRequest; +import com.github.scribejava.core.model.Parameter; +import com.github.scribejava.core.model.Verb; +import com.github.scribejava.core.oauth.OAuth10aService; + +public class OAuthUtilitiesTest extends Flickr4JavaTest { + + @Test + public void testCreateOAuthService() { + OAuth10aService service = OAuthUtilities.createOAuthService("foo", "bar", null, null); + assertEquals("foo", service.getApiKey()); + assertEquals("bar", service.getApiSecret()); + + service = OAuthUtilities.createOAuthService("foo", "bar", 1, 2); + assertEquals("foo", service.getApiKey()); + assertEquals("bar", service.getApiSecret()); + } + + @Test + public void testSignRequest() { + // No proxy credentials + OAuth10aService service = new ServiceBuilder("foo").build(FlickrApi.instance()); + OAuthRequest request = new OAuthRequest(Verb.GET, "http://foobar"); + assertTrue(request.getOauthParameters().isEmpty()); + OAuthUtilities.signRequest(service, request, null); + assertNull(request.getHeaders().get("Proxy-Authorization")); + + // proxy credentials + service = new ServiceBuilder("foo").apiSecret("bar").build(FlickrApi.instance()); + request = new OAuthRequest(Verb.POST, "http://foobar"); + assertTrue(request.getOauthParameters().isEmpty()); + OAuthUtilities.signRequest(service, request, "creds"); + assertEquals("Basic creds", request.getHeaders().get("Proxy-Authorization")); + } + + @Test + public void testBuildNormalPostRequest() { + Map params = new HashMap<>(); + params.put("foo", "bar"); + OAuthRequest request = OAuthUtilities.buildNormalPostRequest(params, "http://foo"); + List bodyParams = request.getBodyParams().getParams(); + assertEquals(1, bodyParams.size()); + assertEquals(new Parameter("foo", "bar"), bodyParams.get(0)); + } + + @Test + public void testBuildMultipartRequest() { + Map params = new HashMap<>(); + params.put("foo", "bar"); + OAuthRequest request = OAuthUtilities.buildMultipartRequest(params, "http://foo"); + List queryStringParams = request.getQueryStringParams().getParams(); + assertEquals(1, queryStringParams.size()); + assertEquals(new Parameter("foo", "bar"), queryStringParams.get(0)); + String contentType = request.getHeaders().get("Content-Type"); + assertTrue(contentType, contentType.matches( + "multipart/form-data; boundary=---------------------------[a-f0-9]{8}(-[a-f0-9]{4}){4}[a-f0-9]{8}")); + } +} diff --git a/src/test/java/com/flickr4java/flickr/test/PhotosInterfaceTest.java b/src/test/java/com/flickr4java/flickr/test/PhotosInterfaceTest.java index e7f785a7..5d2e1db3 100644 --- a/src/test/java/com/flickr4java/flickr/test/PhotosInterfaceTest.java +++ b/src/test/java/com/flickr4java/flickr/test/PhotosInterfaceTest.java @@ -197,7 +197,6 @@ public void testAddAndRemoveTags() throws FlickrException { // Find number of existing tags int preCount = photo.getTags().size(); - int postCount = preCount + 1; // Add a tag String[] tagsToAdd = { "test" }; diff --git a/src/test/java/com/flickr4java/flickr/test/util/FileTestProperties.java b/src/test/java/com/flickr4java/flickr/test/util/FileTestProperties.java index 31470ac2..90457865 100644 --- a/src/test/java/com/flickr4java/flickr/test/util/FileTestProperties.java +++ b/src/test/java/com/flickr4java/flickr/test/util/FileTestProperties.java @@ -1,8 +1,6 @@ package com.flickr4java.flickr.test.util; import com.flickr4java.flickr.FlickrRuntimeException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.io.File; import java.io.FileInputStream; @@ -20,11 +18,6 @@ */ public class FileTestProperties implements TestProperties { - /** - * Logger. - */ - private static Logger _log = LoggerFactory.getLogger(FileTestProperties.class); - private String host; private String apiKey; diff --git a/src/test/java/com/flickr4java/flickr/test/util/TransportStub.java b/src/test/java/com/flickr4java/flickr/test/util/TransportStub.java index 0a8a54f6..368cca1f 100644 --- a/src/test/java/com/flickr4java/flickr/test/util/TransportStub.java +++ b/src/test/java/com/flickr4java/flickr/test/util/TransportStub.java @@ -4,8 +4,6 @@ import com.flickr4java.flickr.uploader.Payload; import com.flickr4java.flickr.uploader.UploadMetaData; import com.flickr4java.flickr.uploader.UploaderResponse; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.xml.sax.InputSource; @@ -17,13 +15,10 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.HashMap; import java.util.Map; public class TransportStub extends Transport { - private static final Logger _log = LoggerFactory.getLogger(TransportStub.class); - private final DocumentBuilder builder; public TransportStub() { From 676a4ba4fc4318cdeb46f6c9fe98567dde2fc3bb Mon Sep 17 00:00:00 2001 From: boncey Date: Sat, 2 May 2020 16:33:01 +0100 Subject: [PATCH 2/3] Add source element to fix Javadoc issue --- pom.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pom.xml b/pom.xml index c72ca81d..93b54005 100644 --- a/pom.xml +++ b/pom.xml @@ -119,6 +119,9 @@ org.apache.maven.plugins maven-javadoc-plugin 3.2.0 + + 8 + attach-javadocs From aef7cf530aaabc678cd7e9a530e8bace757ca546 Mon Sep 17 00:00:00 2001 From: boncey Date: Sat, 2 May 2020 16:33:22 +0100 Subject: [PATCH 3/3] Reduce Javadoc warnings --- src/examples/java/UploadPhoto.java | 2 +- .../com/flickr4java/flickr/Transport.java | 6 +- .../flickr/activity/ActivityInterface.java | 4 +- .../flickr/auth/AuthInterface.java | 6 +- .../flickr/blogs/BlogsInterface.java | 6 +- .../flickr/cameras/CamerasInterface.java | 4 +- .../collections/CollectionsInterface.java | 4 +- .../flickr/commons/CommonsInterface.java | 2 +- .../flickr/contacts/ContactsInterface.java | 4 +- .../flickr/favorites/FavoritesInterface.java | 4 +- .../flickr/galleries/GalleriesInterface.java | 8 +-- .../flickr/groups/GroupsInterface.java | 4 +- .../groups/discuss/GroupDiscussInterface.java | 8 +-- .../groups/members/MembersInterface.java | 2 +- .../flickr/groups/pools/PoolsInterface.java | 10 ++-- .../InterestingnessInterface.java | 6 +- .../machinetags/MachinetagsInterface.java | 10 ++-- .../flickr/panda/PandaInterface.java | 4 +- .../flickr/people/PeopleInterface.java | 24 ++++---- .../com/flickr4java/flickr/photos/Photo.java | 6 +- .../flickr/photos/PhotosInterface.java | 56 +++++++++---------- .../photos/comments/CommentsInterface.java | 10 ++-- .../flickr/photos/geo/GeoInterface.java | 18 +++--- .../photos/licenses/LicensesInterface.java | 4 +- .../flickr/photos/notes/NotesInterface.java | 4 +- .../flickr/photos/people/PeopleInterface.java | 8 +-- .../flickr/photos/upload/UploadInterface.java | 2 +- .../flickr/photosets/PhotosetsInterface.java | 34 +++++------ .../comments/PhotosetsCommentsInterface.java | 8 +-- .../flickr/places/PlacesInterface.java | 30 +++++----- .../flickr/prefs/PrefsInterface.java | 10 ++-- .../reflection/ReflectionInterface.java | 4 +- .../flickr/stats/StatsInterface.java | 6 +- .../flickr/tags/TagsInterface.java | 12 ++-- .../flickr/test/TestInterface.java | 6 +- .../flickr4java/flickr/uploader/Uploader.java | 12 ++-- .../flickr/urls/UrlsInterface.java | 12 ++-- .../flickr/test/Flickr4JavaTest.java | 2 +- .../flickr4java/flickr/test/UploaderTest.java | 8 +-- 39 files changed, 185 insertions(+), 185 deletions(-) diff --git a/src/examples/java/UploadPhoto.java b/src/examples/java/UploadPhoto.java index bd1181c9..bfaa1f9e 100644 --- a/src/examples/java/UploadPhoto.java +++ b/src/examples/java/UploadPhoto.java @@ -124,7 +124,7 @@ private void setUserName() throws FlickrException { /** * Check local saved copy first ??. If Auth by username is available, then we will not need to make the API call. * - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ private void setNsid() throws FlickrException { diff --git a/src/main/java/com/flickr4java/flickr/Transport.java b/src/main/java/com/flickr4java/flickr/Transport.java index a0e7a7a9..162db44c 100644 --- a/src/main/java/com/flickr4java/flickr/Transport.java +++ b/src/main/java/com/flickr4java/flickr/Transport.java @@ -89,7 +89,7 @@ public void setScheme(String scheme) { * @param apiKey * @param sharedSecret * @return The Response - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public abstract Response get(String path, Map parameters, String apiKey, String sharedSecret) throws FlickrException; @@ -103,7 +103,7 @@ public void setScheme(String scheme) { * @param apiKey * @param sharedSecret * @return The Response object - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public abstract Response post(String path, Map parameters, String apiKey, String sharedSecret) throws FlickrException; @@ -118,7 +118,7 @@ public void setScheme(String scheme) { * @param apiKey * @param sharedSecret * @return The Response object - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public abstract Response postMultiPart(String path, UploadMetaData parameters, Payload payload, String apiKey, String sharedSecret) throws FlickrException; diff --git a/src/main/java/com/flickr4java/flickr/activity/ActivityInterface.java b/src/main/java/com/flickr4java/flickr/activity/ActivityInterface.java index b648ccf7..0dacaa5a 100644 --- a/src/main/java/com/flickr4java/flickr/activity/ActivityInterface.java +++ b/src/main/java/com/flickr4java/flickr/activity/ActivityInterface.java @@ -45,7 +45,7 @@ public ActivityInterface(String apiKey, String sharedSecret, Transport transport * @param perPage * @param page * @return ItemList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public ItemList userComments(int perPage, int page) throws FlickrException { ItemList items = new ItemList(); @@ -88,7 +88,7 @@ public ItemList userComments(int perPage, int page) throws FlickrException * @param page * @param timeframe * @return ItemList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public ItemList userPhotos(int perPage, int page, String timeframe) throws FlickrException { ItemList items = new ItemList(); diff --git a/src/main/java/com/flickr4java/flickr/auth/AuthInterface.java b/src/main/java/com/flickr4java/flickr/auth/AuthInterface.java index 747be969..358a1415 100644 --- a/src/main/java/com/flickr4java/flickr/auth/AuthInterface.java +++ b/src/main/java/com/flickr4java/flickr/auth/AuthInterface.java @@ -159,7 +159,7 @@ public OAuth1Token getAccessToken(OAuth1RequestToken oAuthRequestToken, String v * @param accessToken * The authentication token * @return The Auth object - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Auth checkToken(OAuth1Token accessToken) throws FlickrException { return checkToken(accessToken.getToken(), accessToken.getTokenSecret()); @@ -171,7 +171,7 @@ public Auth checkToken(OAuth1Token accessToken) throws FlickrException { * The authentication token * @param tokenSecret * @return The Auth object - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * @see "http://www.flickr.com/services/api/flickr.auth.oauth.checkToken.html" */ public Auth checkToken(String authToken, String tokenSecret) throws FlickrException { @@ -199,7 +199,7 @@ public Auth checkToken(String authToken, String tokenSecret) throws FlickrExcept * Calling this method will delete the auth token used to make the request. * * @param authToken - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * @see "http://www.flickr.com/services/api/flickr.auth.oauth.getAccessToken.html" */ public OAuth1RequestToken exchangeAuthToken(String authToken) throws FlickrException { diff --git a/src/main/java/com/flickr4java/flickr/blogs/BlogsInterface.java b/src/main/java/com/flickr4java/flickr/blogs/BlogsInterface.java index e97642e4..d3f11461 100644 --- a/src/main/java/com/flickr4java/flickr/blogs/BlogsInterface.java +++ b/src/main/java/com/flickr4java/flickr/blogs/BlogsInterface.java @@ -48,7 +48,7 @@ public BlogsInterface(String apiKey, String sharedSecret, Transport transport) { * This method does not require authentication. * * @return List of Services - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection getServices() throws FlickrException { List list = new ArrayList(); @@ -80,7 +80,7 @@ public Collection getServices() throws FlickrException { * The blog ID * @param blogPassword * The blog password - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void postPhoto(Photo photo, String blogId, String blogPassword) throws FlickrException { Map parameters = new HashMap(); @@ -107,7 +107,7 @@ public void postPhoto(Photo photo, String blogId, String blogPassword) throws Fl * The photo metadata * @param blogId * The blog ID - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void postPhoto(Photo photo, String blogId) throws FlickrException { postPhoto(photo, blogId, null); diff --git a/src/main/java/com/flickr4java/flickr/cameras/CamerasInterface.java b/src/main/java/com/flickr4java/flickr/cameras/CamerasInterface.java index b9f87aab..457a9ff8 100644 --- a/src/main/java/com/flickr4java/flickr/cameras/CamerasInterface.java +++ b/src/main/java/com/flickr4java/flickr/cameras/CamerasInterface.java @@ -53,7 +53,7 @@ public CamerasInterface(String apiKey, String sharedSecret, Transport transportA * * * @return List of Brands - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public List getBrands() throws FlickrException { Map parameters = new HashMap(); @@ -85,7 +85,7 @@ public List getBrands() throws FlickrException { * * * @return List of Brands - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public List getBrandModels(String strBrand) throws FlickrException { Map parameters = new HashMap(); diff --git a/src/main/java/com/flickr4java/flickr/collections/CollectionsInterface.java b/src/main/java/com/flickr4java/flickr/collections/CollectionsInterface.java index ca6cc101..80856155 100644 --- a/src/main/java/com/flickr4java/flickr/collections/CollectionsInterface.java +++ b/src/main/java/com/flickr4java/flickr/collections/CollectionsInterface.java @@ -55,7 +55,7 @@ public CollectionsInterface(String apiKey, String sharedSecret, Transport transp * the id of the collection (from the getTree call, not from the collection URL). * * @return the given Collection - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection getInfo(String collectionId) throws FlickrException { Map parameters = new HashMap(); @@ -83,7 +83,7 @@ public Collection getInfo(String collectionId) throws FlickrException { * the user id of the collection owner (optional - defaults to calling user). * * @return List of Institution - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public List getTree(String collectionId, String userId) throws FlickrException { Map parameters = new HashMap(); diff --git a/src/main/java/com/flickr4java/flickr/commons/CommonsInterface.java b/src/main/java/com/flickr4java/flickr/commons/CommonsInterface.java index ebabc201..93927010 100644 --- a/src/main/java/com/flickr4java/flickr/commons/CommonsInterface.java +++ b/src/main/java/com/flickr4java/flickr/commons/CommonsInterface.java @@ -38,7 +38,7 @@ public CommonsInterface(String apiKey, String sharedSecret, Transport transportA * This method does not require authentication. * * @return List of Institution - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public ArrayList getInstitutions() throws FlickrException { ArrayList institutions = new ArrayList(); diff --git a/src/main/java/com/flickr4java/flickr/contacts/ContactsInterface.java b/src/main/java/com/flickr4java/flickr/contacts/ContactsInterface.java index d8e66d25..90790e6a 100644 --- a/src/main/java/com/flickr4java/flickr/contacts/ContactsInterface.java +++ b/src/main/java/com/flickr4java/flickr/contacts/ContactsInterface.java @@ -98,7 +98,7 @@ public Collection getList() throws FlickrException { * Valid options are: ff -> friends and family, all -> all your contacts. (Optional, can be null) * * @return List of Contacts - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection getListRecentlyUploaded(Date lastUpload, String filter) throws FlickrException { List contacts = new ArrayList(); @@ -149,7 +149,7 @@ public Collection getListRecentlyUploaded(Date lastUpload, String filte * @param userId * The user ID * @return The Collection of Contact objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection getPublicList(String userId) throws FlickrException { List contacts = new ArrayList(); diff --git a/src/main/java/com/flickr4java/flickr/favorites/FavoritesInterface.java b/src/main/java/com/flickr4java/flickr/favorites/FavoritesInterface.java index 6b04ed8e..d226c0b1 100644 --- a/src/main/java/com/flickr4java/flickr/favorites/FavoritesInterface.java +++ b/src/main/java/com/flickr4java/flickr/favorites/FavoritesInterface.java @@ -56,7 +56,7 @@ public FavoritesInterface(String apiKey, String sharedSecret, Transport transpor * * @param photoId * The photo ID - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void add(String photoId) throws FlickrException { Map parameters = new HashMap(); @@ -134,7 +134,7 @@ public PhotoList getList(String userId, int perPage, int page, Set getPublicList(String userId, int perPage, int page, Set extras) throws FlickrException { diff --git a/src/main/java/com/flickr4java/flickr/galleries/GalleriesInterface.java b/src/main/java/com/flickr4java/flickr/galleries/GalleriesInterface.java index d7cf1b7e..fbc2974f 100644 --- a/src/main/java/com/flickr4java/flickr/galleries/GalleriesInterface.java +++ b/src/main/java/com/flickr4java/flickr/galleries/GalleriesInterface.java @@ -75,7 +75,7 @@ public GalleriesInterface(String apiKey, String sharedSecret, Transport transpor * @param page * The page number * @return gallery - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * * @see flickr.galleries.getList */ @@ -214,7 +214,7 @@ public Gallery getInfo(String strGalleryId) throws FlickrException { * @param strTitle * @param strDescription * @param primaryPhotoId - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Gallery create(String strTitle, String strDescription, String primaryPhotoId) throws FlickrException { Map parameters = new HashMap(); @@ -255,7 +255,7 @@ public Gallery create(String strTitle, String strDescription, String primaryPhot * @param page * The page offset (0 to ignore) * @return A Collection of Photo objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getPhotos(String galleryId, Set extras, int perPage, int page) throws FlickrException { PhotoList photos = new PhotoList(); @@ -330,7 +330,7 @@ public PhotoList getPhotos(String galleryId, Set extras, int perP * @param page * The page offset (0 to ignore) * @return A Collection of Photo objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getListForPhoto(String photoId, int perPage, int page) throws FlickrException { PhotoList photos = new PhotoList(); diff --git a/src/main/java/com/flickr4java/flickr/groups/GroupsInterface.java b/src/main/java/com/flickr4java/flickr/groups/GroupsInterface.java index 181b3898..17848438 100644 --- a/src/main/java/com/flickr4java/flickr/groups/GroupsInterface.java +++ b/src/main/java/com/flickr4java/flickr/groups/GroupsInterface.java @@ -58,7 +58,7 @@ public GroupsInterface(String apiKey, String sharedSecret, Transport transportAP * @param catId * The optional category id. Null value will be ignored. * @return The Collection of Photo objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * @deprecated Flickr returns just empty results */ @Deprecated @@ -209,7 +209,7 @@ public Group getInfo(String groupId) throws FlickrException { * @param page * The page of results to return. If this argument is 0, it defaults to 1. * @return A GroupList Object. Only the fields id, name and eighteenplus in the Groups will be set. - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection search(String text, int perPage, int page) throws FlickrException { GroupList groupList = new GroupList(); diff --git a/src/main/java/com/flickr4java/flickr/groups/discuss/GroupDiscussInterface.java b/src/main/java/com/flickr4java/flickr/groups/discuss/GroupDiscussInterface.java index 319ab155..bccde79d 100644 --- a/src/main/java/com/flickr4java/flickr/groups/discuss/GroupDiscussInterface.java +++ b/src/main/java/com/flickr4java/flickr/groups/discuss/GroupDiscussInterface.java @@ -48,7 +48,7 @@ public GroupDiscussInterface(String apiKey, String sharedSecret, Transport trans * @param page * Result-section. * @return A group topic list - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * @see API Documentation */ public TopicList getTopicsList(String groupId, int perPage, int page) throws FlickrException { @@ -98,7 +98,7 @@ public TopicList getTopicsList(String groupId, int perPage, int page) thr * @param topicId * Unique identifier of a topic for a given group {@link Topic}. * @return A group topic - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * @see API Documentation */ public Topic getTopicInfo(String topicId) throws FlickrException { @@ -122,7 +122,7 @@ public Topic getTopicInfo(String topicId) throws FlickrException { * @param topicId * Unique identifier of a topic for a given group {@link Topic}. * @return A reply object - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * @see API Documentation */ public ReplyObject getReplyList(String topicId, int perPage, int page) throws FlickrException { @@ -174,7 +174,7 @@ public ReplyObject getReplyList(String topicId, int perPage, int page) throws Fl * @param replyId * Unique identifier of a reply for a given topic {@link Reply}. * @return A group topic - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * @see API Documentation */ public Reply getReplyInfo(String topicId, String replyId) throws FlickrException { diff --git a/src/main/java/com/flickr4java/flickr/groups/members/MembersInterface.java b/src/main/java/com/flickr4java/flickr/groups/members/MembersInterface.java index 9fcbec16..623423cc 100644 --- a/src/main/java/com/flickr4java/flickr/groups/members/MembersInterface.java +++ b/src/main/java/com/flickr4java/flickr/groups/members/MembersInterface.java @@ -46,7 +46,7 @@ public MembersInterface(String apiKey, String sharedSecret, Transport transportA * @param page * Result-section. * @return A members-list - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * @see API Documentation */ public MembersList getList(String groupId, Set memberTypes, int perPage, int page) throws FlickrException { diff --git a/src/main/java/com/flickr4java/flickr/groups/pools/PoolsInterface.java b/src/main/java/com/flickr4java/flickr/groups/pools/PoolsInterface.java index a32b14b1..2cde3be8 100644 --- a/src/main/java/com/flickr4java/flickr/groups/pools/PoolsInterface.java +++ b/src/main/java/com/flickr4java/flickr/groups/pools/PoolsInterface.java @@ -84,7 +84,7 @@ public void add(String photoId, String groupId) throws FlickrException { * @param groupId * The group ID * @return The PhotoContext - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoContext getContext(String photoId, String groupId) throws FlickrException { Map parameters = new HashMap(); @@ -120,7 +120,7 @@ public PhotoContext getContext(String photoId, String groupId) throws FlickrExce * Get a collection of all of the user's groups. * * @return A Collection of Group objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection getGroups() throws FlickrException { GroupList groups = new GroupList(); @@ -172,7 +172,7 @@ public Collection getGroups() throws FlickrException { * @param page * The page offset (0 to ignore) * @return A Collection of Photo objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getPhotos(String groupId, String userId, String[] tags, Set extras, int perPage, int page) throws FlickrException { PhotoList photos = new PhotoList(); @@ -242,7 +242,7 @@ public PhotoList getPhotos(String groupId, String userId, String[] tags, * @param page * The page offset (0 to ignore) * @return A Collection of Photo objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getPhotos(String groupId, String[] tags, Set extras, int perPage, int page) throws FlickrException { return getPhotos(groupId, null, tags, extras, perPage, page); @@ -275,7 +275,7 @@ public PhotoList getPhotos(String groupId, String[] tags, int perPage, in * The photo ID * @param groupId * The group ID - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void remove(String photoId, String groupId) throws FlickrException { Map parameters = new HashMap(); diff --git a/src/main/java/com/flickr4java/flickr/interestingness/InterestingnessInterface.java b/src/main/java/com/flickr4java/flickr/interestingness/InterestingnessInterface.java index 37c3704b..29ccbfee 100644 --- a/src/main/java/com/flickr4java/flickr/interestingness/InterestingnessInterface.java +++ b/src/main/java/com/flickr4java/flickr/interestingness/InterestingnessInterface.java @@ -76,7 +76,7 @@ public InterestingnessInterface(String apiKey, String sharedSecret, Transport tr * @param page * The page offset * @return PhotoList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * @see com.flickr4java.flickr.photos.Extras */ public PhotoList getList(String date, Set extras, int perPage, int page) throws FlickrException { @@ -126,7 +126,7 @@ public PhotoList getList(String date, Set extras, int perPage, in * @param perPage * @param page * @return PhotoList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * @see com.flickr4java.flickr.photos.Extras */ public PhotoList getList(Date date, Set extras, int perPage, int page) throws FlickrException { @@ -142,7 +142,7 @@ public PhotoList getList(Date date, Set extras, int perPage, int * convenience method to get the list of all 500 most recent photos in flickr explore with all known extra attributes. * * @return a List of Photos - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getList() throws FlickrException { return getList((String) null, Extras.ALL_EXTRAS, 500, 1); diff --git a/src/main/java/com/flickr4java/flickr/machinetags/MachinetagsInterface.java b/src/main/java/com/flickr4java/flickr/machinetags/MachinetagsInterface.java index b1a21f1f..0621dbe3 100644 --- a/src/main/java/com/flickr4java/flickr/machinetags/MachinetagsInterface.java +++ b/src/main/java/com/flickr4java/flickr/machinetags/MachinetagsInterface.java @@ -261,7 +261,7 @@ public MachinetagsInterface(String apiKey, String sharedSecret, Transport transp * @param perPage * @param page * @return NamespacesList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public NamespacesList getNamespaces(String predicate, int perPage, int page) throws FlickrException { Map parameters = new HashMap(); @@ -309,7 +309,7 @@ public NamespacesList getNamespaces(String predicate, int perPage, in * @param page * The page offset * @return NamespacesList containing Pair-objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public NamespacesList getPairs(String namespace, String predicate, int perPage, int page) throws FlickrException { Map parameters = new HashMap(); @@ -358,7 +358,7 @@ public NamespacesList getPairs(String namespace, String predicate, int per * @param page * The page offset * @return NamespacesList containing Predicate - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public NamespacesList getPredicates(String namespace, int perPage, int page) throws FlickrException { Map parameters = new HashMap(); @@ -406,7 +406,7 @@ public NamespacesList getPredicates(String namespace, int perPage, in * @param page * The page offset * @return NamespacesList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public NamespacesList getValues(String namespace, String predicate, int perPage, int page) throws FlickrException { Map parameters = new HashMap(); @@ -458,7 +458,7 @@ public NamespacesList getValues(String namespace, String predicate, int p * @param addedSince * Only return machine tags values that have been added since this Date. * @return NamespacesList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public NamespacesList getRecentValues(String namespace, String predicate, Date addedSince) throws FlickrException { Map parameters = new HashMap(); diff --git a/src/main/java/com/flickr4java/flickr/panda/PandaInterface.java b/src/main/java/com/flickr4java/flickr/panda/PandaInterface.java index b7b9ce8f..126c053f 100644 --- a/src/main/java/com/flickr4java/flickr/panda/PandaInterface.java +++ b/src/main/java/com/flickr4java/flickr/panda/PandaInterface.java @@ -48,7 +48,7 @@ public PandaInterface(String apiKey, String sharedSecret, Transport transportAPI * This method does not require authentication. * * @return A list of pandas - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public ArrayList getList() throws FlickrException { ArrayList pandas = new ArrayList(); @@ -84,7 +84,7 @@ public ArrayList getList() throws FlickrException { * @param page * The page offset * @return A PhotoList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * @see com.flickr4java.flickr.photos.Extras */ public PhotoList getPhotos(Panda panda, Set extras, int perPage, int page) throws FlickrException { diff --git a/src/main/java/com/flickr4java/flickr/people/PeopleInterface.java b/src/main/java/com/flickr4java/flickr/people/PeopleInterface.java index efb9293e..1286b1b7 100644 --- a/src/main/java/com/flickr4java/flickr/people/PeopleInterface.java +++ b/src/main/java/com/flickr4java/flickr/people/PeopleInterface.java @@ -75,7 +75,7 @@ public PeopleInterface(String apiKey, String sharedSecret, Transport transportAP * @param email * The email address * @return The User - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public User findByEmail(String email) throws FlickrException { Map parameters = new HashMap(); @@ -102,7 +102,7 @@ public User findByEmail(String email) throws FlickrException { * @param username * The username * @return The User object - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public User findByUsername(String username) throws FlickrException { Map parameters = new HashMap(); @@ -129,7 +129,7 @@ public User findByUsername(String username) throws FlickrException { * @param userId * The user ID * @return The User object - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public User getInfo(String userId) throws FlickrException { Map parameters = new HashMap(); @@ -196,7 +196,7 @@ public User getInfo(String userId) throws FlickrException { * @param userId * The user ID * @return The public groups - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection getPublicGroups(String userId) throws FlickrException { List groups = new ArrayList(); @@ -243,7 +243,7 @@ public PhotoList getPublicPhotos(String userId, int perPage, int page) th * @param page * The page offset * @return The PhotoList collection - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getPublicPhotos(String userId, Set extras, int perPage, int page) throws FlickrException { PhotoList photos = new PhotoList(); @@ -288,7 +288,7 @@ public PhotoList getPublicPhotos(String userId, Set extras, int p * Requires authentication with 'read' permission using the new authentication API. * * @return A User object with upload status data fields filled - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public User getUploadStatus() throws FlickrException { Map parameters = new HashMap(); @@ -440,7 +440,7 @@ public PhotoList getPhotosOf(String userId, String ownerId, Set e * @param photoId * @param userId * @param bounds - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void add(String photoId, String userId, Rectangle bounds) throws FlickrException { @@ -454,7 +454,7 @@ public void add(String photoId, String userId, Rectangle bounds) throws FlickrEx * * @param photoId * @param userId - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void delete(String photoId, String userId) throws FlickrException { @@ -468,7 +468,7 @@ public void delete(String photoId, String userId) throws FlickrException { * * @param photoId * @param userId - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void deleteCoords(String photoId, String userId) throws FlickrException { @@ -483,7 +483,7 @@ public void deleteCoords(String photoId, String userId) throws FlickrException { * @param photoId * @param userId * @param bounds - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void editCoords(String photoId, String userId, Rectangle bounds) throws FlickrException { @@ -496,7 +496,7 @@ public void editCoords(String photoId, String userId, Rectangle bounds) throws F * Get a list of people in a given photo. * * @param photoId - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PersonTagList getList(String photoId) throws FlickrException { @@ -508,7 +508,7 @@ public PersonTagList getList(String photoId) throws FlickrException { /** * * @param userId - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public GroupList getGroups(String userId) throws FlickrException { diff --git a/src/main/java/com/flickr4java/flickr/photos/Photo.java b/src/main/java/com/flickr4java/flickr/photos/Photo.java index 6c385f8d..cc18d532 100644 --- a/src/main/java/com/flickr4java/flickr/photos/Photo.java +++ b/src/main/java/com/flickr4java/flickr/photos/Photo.java @@ -570,7 +570,7 @@ public void setOriginalSecret(String originalSecret) { * @see PhotosInterface#getImage(Photo, int) * @return An Image * @throws IOException - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ @Deprecated public BufferedImage getOriginalImage() throws IOException, FlickrException { @@ -878,7 +878,7 @@ private BufferedImage getImage(String suffix) throws IOException { * The URL suffix, including the .extension * @return The BufferedImage object * @throws IOException - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ @Deprecated private BufferedImage getOriginalImage(String suffix) throws IOException, FlickrException { @@ -931,7 +931,7 @@ private InputStream getImageAsStream(String suffix) throws IOException { * @param suffix * @return InoutStream * @throws IOException - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ @Deprecated private InputStream getOriginalImageAsStream(String suffix) throws IOException, FlickrException { diff --git a/src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java b/src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java index a8cff448..36e5c90e 100644 --- a/src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java +++ b/src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java @@ -137,7 +137,7 @@ public synchronized GeoInterface getGeoInterface() { * The photo ID * @param tags * The tags - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void addTags(String photoId, String[] tags) throws FlickrException { Map parameters = new HashMap(); @@ -158,7 +158,7 @@ public void addTags(String photoId, String[] tags) throws FlickrException { * This method requires authentication with 'delete' permission. * * @param photoId - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void delete(String photoId) throws FlickrException { Map parameters = new HashMap(); @@ -183,7 +183,7 @@ public void delete(String photoId) throws FlickrException { * @param photoId * The photo to return information for. * @return a list of {@link PhotoContext} objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoAllContext getAllContexts(String photoId) throws FlickrException { PhotoSetList setList = new PhotoSetList(); @@ -248,7 +248,7 @@ public PhotoAllContext getAllContexts(String photoId) throws FlickrException { * @param includeSelf * Set to true to include self * @return The Collection of photos - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getContactsPhotos(int count, boolean justFriends, boolean singlePhoto, boolean includeSelf) throws FlickrException { PhotoList photos = new PhotoList(); @@ -303,7 +303,7 @@ public PhotoList getContactsPhotos(int count, boolean justFriends, boolea * @param includeSelf * True to include self * @return A collection of Photo objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getContactsPublicPhotos(String userId, int count, boolean justFriends, boolean singlePhoto, boolean includeSelf) throws FlickrException { @@ -369,7 +369,7 @@ public PhotoList getContactsPublicPhotos(String userId, Set extra * @param photoId * The photo ID * @return The PhotoContext - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoContext getContext(String photoId) throws FlickrException { Map parameters = new HashMap(); @@ -472,7 +472,7 @@ public Collection getCounts(Date[] dates, Date[] takenDates) throws * @param secret * The secret * @return A collection of Exif objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection getExif(String photoId, String secret) throws FlickrException { Map parameters = new HashMap(); @@ -560,7 +560,7 @@ public Collection getFavorites(String photoId, int perPage, int page) thro * @param secret * The optional secret String * @return The Photo - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Photo getInfo(String photoId, String secret) throws FlickrException { Map parameters = new HashMap(); @@ -590,7 +590,7 @@ public Photo getInfo(String photoId, String secret) throws FlickrException { * @param page * The page * @return The collection of Photo objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getNotInSet(int perPage, int page) throws FlickrException { PhotoList photos = new PhotoList(); @@ -638,7 +638,7 @@ public PhotoList getNotInSet(int perPage, int page) throws FlickrExceptio * @param photoId * The photo id * @return The Permissions object - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Permissions getPerms(String photoId) throws FlickrException { Map parameters = new HashMap(); @@ -674,7 +674,7 @@ public Permissions getPerms(String photoId) throws FlickrException { * @param page * The page offset * @return A collection of Photo objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getRecent(Set extras, int perPage, int page) throws FlickrException { Map parameters = new HashMap(); @@ -709,7 +709,7 @@ public PhotoList getRecent(Set extras, int perPage, int page) thr * @param photoId * The photo ID * @return A collection of {@link Size} - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection getSizes(String photoId) throws FlickrException { return getSizes(photoId, false); @@ -727,7 +727,7 @@ public Collection getSizes(String photoId) throws FlickrException { * @param sign * toggle to allow optionally signing the call (Authenticate) * @return A collection of {@link Size} - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection getSizes(String photoId, boolean sign) throws FlickrException { SizeList sizes = new SizeList(); @@ -768,7 +768,7 @@ public Collection getSizes(String photoId, boolean sign) throws FlickrExce * @param perPage * @param page * @return A Collection of Photos - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getUntagged(int perPage, int page) throws FlickrException { Map parameters = new HashMap(); @@ -826,7 +826,7 @@ public PhotoList getUntagged(int perPage, int page) throws FlickrExceptio * @param page * The page of results to return. If this argument is 0, it defaults to 1. * @return photos - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getWithGeoData(Date minUploadDate, Date maxUploadDate, Date minTakenDate, Date maxTakenDate, int privacyFilter, String sort, Set extras, int perPage, int page) throws FlickrException { @@ -906,7 +906,7 @@ public PhotoList getWithGeoData(Date minUploadDate, Date maxUploadDate, D * @param page * The page of results to return. If this argument is 0, it defaults to 1. * @return a photo list - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getWithoutGeoData(Date minUploadDate, Date maxUploadDate, Date minTakenDate, Date maxTakenDate, int privacyFilter, String sort, Set extras, int perPage, int page) throws FlickrException { @@ -967,7 +967,7 @@ public PhotoList getWithoutGeoData(Date minUploadDate, Date maxUploadDate * @param page * The page of results to return. If this argument is 0, it defaults to 1. * @return a list of photos - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList recentlyUpdated(Date minDate, Set extras, int perPage, int page) throws FlickrException { Map parameters = new HashMap(); @@ -1001,7 +1001,7 @@ public PhotoList recentlyUpdated(Date minDate, Set extras, int pe * * @param tagId * The tag ID - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void removeTag(String tagId) throws FlickrException { Map parameters = new HashMap(); @@ -1025,7 +1025,7 @@ public void removeTag(String tagId) throws FlickrException { * @param page * The page offset * @return A PhotoList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList search(SearchParameters params, int perPage, int page) throws FlickrException { PhotoList photos = new PhotoList(); @@ -1070,7 +1070,7 @@ public PhotoList search(SearchParameters params, int perPage, int page) t * @param page * The page to start on * @return A PhotoList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList searchInterestingness(SearchParameters params, int perPage, int page) throws FlickrException { PhotoList photos = new PhotoList(); @@ -1131,7 +1131,7 @@ public PhotoList searchInterestingness(SearchParameters params, int perPa * The photo ID * @param contentType * The contentType to set - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void setContentType(String photoId, String contentType) throws FlickrException { Map parameters = new HashMap(); @@ -1159,7 +1159,7 @@ public void setContentType(String photoId, String contentType) throws FlickrExce * The date the photo was taken or null * @param dateTakenGranularity * The granularity of the taken date or null - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void setDates(String photoId, Date datePosted, Date dateTaken, String dateTakenGranularity) throws FlickrException { Map parameters = new HashMap(); @@ -1196,7 +1196,7 @@ public void setDates(String photoId, Date datePosted, Date dateTaken, String dat * The new title * @param description * The new description - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void setMeta(String photoId, String title, String description) throws FlickrException { Map parameters = new HashMap(); @@ -1221,7 +1221,7 @@ public void setMeta(String photoId, String title, String description) throws Fli * The photo ID * @param permissions * The permissions object - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void setPerms(String photoId, Permissions permissions) throws FlickrException { Map parameters = new HashMap(); @@ -1255,7 +1255,7 @@ public void setPerms(String photoId, Permissions permissions) throws FlickrExcep * @see com.flickr4java.flickr.Flickr#SAFETYLEVEL_SAFE * @see com.flickr4java.flickr.Flickr#SAFETYLEVEL_MODERATE * @see com.flickr4java.flickr.Flickr#SAFETYLEVEL_RESTRICTED - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void setSafetyLevel(String photoId, String safetyLevel, Boolean hidden) throws FlickrException { Map parameters = new HashMap(); @@ -1286,7 +1286,7 @@ public void setSafetyLevel(String photoId, String safetyLevel, Boolean hidden) t * The photo ID * @param tags * The tag array - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void setTags(String photoId, String[] tags) throws FlickrException { Map parameters = new HashMap(); @@ -1337,7 +1337,7 @@ public Photo getPhoto(String id, String secret) throws FlickrException { * @param size * The Size * @return InputStream The InputStream - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public InputStream getImageAsStream(Photo photo, int size) throws FlickrException { try { @@ -1404,7 +1404,7 @@ public InputStream getImageAsStream(Photo photo, int size) throws FlickrExceptio * @param size * The size * @return An Image - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public BufferedImage getImage(Photo photo, int size) throws FlickrException { try { diff --git a/src/main/java/com/flickr4java/flickr/photos/comments/CommentsInterface.java b/src/main/java/com/flickr4java/flickr/photos/comments/CommentsInterface.java index 9e6bae28..b86947a9 100644 --- a/src/main/java/com/flickr4java/flickr/photos/comments/CommentsInterface.java +++ b/src/main/java/com/flickr4java/flickr/photos/comments/CommentsInterface.java @@ -59,7 +59,7 @@ public CommentsInterface(String apiKey, String sharedSecret, Transport transport * @param commentText * Text of the comment. * @return a unique comment id. - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public String addComment(String photoId, String commentText) throws FlickrException { Map parameters = new HashMap(); @@ -84,7 +84,7 @@ public String addComment(String photoId, String commentText) throws FlickrExcept * * @param commentId * The id of the comment to delete. - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void deleteComment(String commentId) throws FlickrException { Map parameters = new HashMap(); @@ -110,7 +110,7 @@ public void deleteComment(String commentId) throws FlickrException { * The id of the comment to edit. * @param commentText * Update the comment to this text. - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void editComment(String commentId, String commentText) throws FlickrException { Map parameters = new HashMap(); @@ -136,7 +136,7 @@ public void editComment(String commentId, String commentText) throws FlickrExcep * @param photoId * The id of the photo to fetch comments for. * @return a List of {@link Comment} objects. - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public List getList(String photoId) throws FlickrException { Map parameters = new HashMap(); @@ -206,7 +206,7 @@ public List getList(String photoId) throws FlickrException { * @param page * The page offset. * @return List of photos - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getRecentForContacts(Date lastComment, ArrayList contactsFilter, Set extras, int perPage, int page) throws FlickrException { diff --git a/src/main/java/com/flickr4java/flickr/photos/geo/GeoInterface.java b/src/main/java/com/flickr4java/flickr/photos/geo/GeoInterface.java index 47420178..b7c851ef 100644 --- a/src/main/java/com/flickr4java/flickr/photos/geo/GeoInterface.java +++ b/src/main/java/com/flickr4java/flickr/photos/geo/GeoInterface.java @@ -62,7 +62,7 @@ public GeoInterface(String apiKey, String sharedSecret, Transport transport) { * @param photoId * reqired photo id, not null * @return Geo Data, if the photo has it. - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * if photo id is invalid, if photo has no geodata or if any other error has been reported in the response. */ public GeoData getLocation(String photoId) throws FlickrException { @@ -99,7 +99,7 @@ public GeoData getLocation(String photoId) throws FlickrException { * @param photoId * reqired photo id, not null * @return the permissions - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * if photo id is invalid, if photo has no geodata or if any other error has been reported in the response. */ public GeoPermissions getPerms(String photoId) throws FlickrException { @@ -130,7 +130,7 @@ public GeoPermissions getPerms(String photoId) throws FlickrException { * * This method requires authentication with 'write' permission. * - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void removeLocation(String photoId) throws FlickrException { Map parameters = new HashMap(); @@ -157,7 +157,7 @@ public void removeLocation(String photoId) throws FlickrException { * The id of the photo to cet permissions for. * @param location * geo data with optional accuracy (1-16), accuracy 0 to use the default. - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void setLocation(String photoId, GeoData location) throws FlickrException { Map parameters = new HashMap(); @@ -189,7 +189,7 @@ public void setLocation(String photoId, GeoData location) throws FlickrException * The id of the photo to set permissions for. * @param perms * Permissions, who can see the geo data of this photo - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void setPerms(String photoId, GeoPermissions perms) throws FlickrException { Map parameters = new HashMap(); @@ -221,7 +221,7 @@ public void setPerms(String photoId, GeoPermissions perms) throws FlickrExceptio * A Flickr Places ID. (While optional, you must pass either a valid Places ID or a WOE ID.) * @param woeId * A Where On Earth (WOE) ID. (While optional, you must pass either a valid Places ID or a WOE ID.) - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void batchCorrectLocation(GeoData location, String placeId, String woeId) throws FlickrException { Map parameters = new HashMap(); @@ -254,7 +254,7 @@ public void batchCorrectLocation(GeoData location, String placeId, String woeId) * A Flickr Places ID. (While optional, you must pass either a valid Places ID or a WOE ID.) * @param woeId * A Where On Earth (WOE) ID. (While optional, you must pass either a valid Places ID or a WOE ID.) - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void correctLocation(String photoId, String placeId, String woeId) throws FlickrException { Map parameters = new HashMap(); @@ -285,7 +285,7 @@ public void correctLocation(String photoId, String placeId, String woeId) throws * @param perPage * @param page * @return The collection of Photo objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * @see com.flickr4java.flickr.photos.Extras */ public PhotoList photosForLocation(GeoData location, Set extras, int perPage, int page) throws FlickrException { @@ -334,7 +334,7 @@ public PhotoList photosForLocation(GeoData location, Set extras, * @param context * Context is a numeric value representing the photo's geotagginess beyond latitude and longitude. For example, you may wish to indicate that a * photo was taken "indoors" (1) or "outdoors" (2). - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void setContext(String photoId, int context) throws FlickrException { Map parameters = new HashMap(); diff --git a/src/main/java/com/flickr4java/flickr/photos/licenses/LicensesInterface.java b/src/main/java/com/flickr4java/flickr/photos/licenses/LicensesInterface.java index adaefe2c..7975cbb2 100644 --- a/src/main/java/com/flickr4java/flickr/photos/licenses/LicensesInterface.java +++ b/src/main/java/com/flickr4java/flickr/photos/licenses/LicensesInterface.java @@ -44,7 +44,7 @@ public LicensesInterface(String apiKey, String sharedSecret, Transport transport * This method does not require authentication. * * @return A collection of License objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection getInfo() throws FlickrException { Map parameters = new HashMap(); @@ -77,7 +77,7 @@ public Collection getInfo() throws FlickrException { * The photo to update the license for. * @param licenseId * The license to apply, or 0 (zero) to remove the current license. - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void setLicense(String photoId, int licenseId) throws FlickrException { Map parameters = new HashMap(); diff --git a/src/main/java/com/flickr4java/flickr/photos/notes/NotesInterface.java b/src/main/java/com/flickr4java/flickr/photos/notes/NotesInterface.java index d1bfb140..d30f3e20 100644 --- a/src/main/java/com/flickr4java/flickr/photos/notes/NotesInterface.java +++ b/src/main/java/com/flickr4java/flickr/photos/notes/NotesInterface.java @@ -77,7 +77,7 @@ public Note add(String photoId, Note note) throws FlickrException { * * @param noteId * The node ID - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void delete(String noteId) throws FlickrException { Map parameters = new HashMap(); @@ -96,7 +96,7 @@ public void delete(String noteId) throws FlickrException { * * @param note * The Note to update - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void edit(Note note) throws FlickrException { Map parameters = new HashMap(); diff --git a/src/main/java/com/flickr4java/flickr/photos/people/PeopleInterface.java b/src/main/java/com/flickr4java/flickr/photos/people/PeopleInterface.java index 001c633c..9d50bb84 100644 --- a/src/main/java/com/flickr4java/flickr/photos/people/PeopleInterface.java +++ b/src/main/java/com/flickr4java/flickr/photos/people/PeopleInterface.java @@ -50,7 +50,7 @@ public PeopleInterface(String apiKey, String sharedSecret, Transport transportAP * @param photoId * @param userId * @param bounds - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void add(String photoId, String userId, Rectangle bounds) throws FlickrException { Map parameters = new HashMap(); @@ -76,7 +76,7 @@ public void add(String photoId, String userId, Rectangle bounds) throws FlickrEx * * @param photoId * @param userId - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void delete(String photoId, String userId) throws FlickrException { Map parameters = new HashMap(); @@ -96,7 +96,7 @@ public void delete(String photoId, String userId) throws FlickrException { * * @param photoId * @param userId - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void deleteCoords(String photoId, String userId) throws FlickrException { Map parameters = new HashMap(); @@ -117,7 +117,7 @@ public void deleteCoords(String photoId, String userId) throws FlickrException { * @param photoId * @param userId * @param bounds - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void editCoords(String photoId, String userId, Rectangle bounds) throws FlickrException { Map parameters = new HashMap(); diff --git a/src/main/java/com/flickr4java/flickr/photos/upload/UploadInterface.java b/src/main/java/com/flickr4java/flickr/photos/upload/UploadInterface.java index edc62ed7..a322daa7 100644 --- a/src/main/java/com/flickr4java/flickr/photos/upload/UploadInterface.java +++ b/src/main/java/com/flickr4java/flickr/photos/upload/UploadInterface.java @@ -41,7 +41,7 @@ public UploadInterface(String apiKey, String sharedSecret, Transport transport) * @param tickets * a set of ticket ids (Strings) or {@link Ticket} objects containing ids * @return a list of {@link Ticket} objects. - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public List checkTickets(Set tickets) throws FlickrException { Map parameters = new HashMap(); diff --git a/src/main/java/com/flickr4java/flickr/photosets/PhotosetsInterface.java b/src/main/java/com/flickr4java/flickr/photosets/PhotosetsInterface.java index 5a4ea41f..ea9f1ab8 100644 --- a/src/main/java/com/flickr4java/flickr/photosets/PhotosetsInterface.java +++ b/src/main/java/com/flickr4java/flickr/photosets/PhotosetsInterface.java @@ -108,7 +108,7 @@ public void addPhoto(String photosetId, String photoId) throws FlickrException { * @param primaryPhotoId * The primary photo id * @return The new Photset - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Photoset create(String title, String description, String primaryPhotoId) throws FlickrException { Map parameters = new HashMap(); @@ -134,7 +134,7 @@ public Photoset create(String title, String description, String primaryPhotoId) * * @param photosetId * The photoset ID - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void delete(String photosetId) throws FlickrException { Map parameters = new HashMap(); @@ -157,7 +157,7 @@ public void delete(String photosetId) throws FlickrException { * A new title * @param description * A new description (can be null) - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void editMeta(String photosetId, String title, String description) throws FlickrException { Map parameters = new HashMap(); @@ -184,7 +184,7 @@ public void editMeta(String photosetId, String title, String description) throws * The primary photo Id * @param photoIds * The photo IDs for the photos in the set - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void editPhotos(String photosetId, String primaryPhotoId, String[] photoIds) throws FlickrException { Map parameters = new HashMap(); @@ -210,7 +210,7 @@ public void editPhotos(String photosetId, String primaryPhotoId, String[] photoI * @param photosetId * The photoset ID * @return The PhotoContext - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoContext getContext(String photoId, String photosetId) throws FlickrException { Map parameters = new HashMap(); @@ -252,7 +252,7 @@ public PhotoContext getContext(String photoId, String photosetId) throws FlickrE * @param photosetId * The photoset ID * @return The Photoset - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Photoset getInfo(String photosetId) throws FlickrException { Map parameters = new HashMap(); @@ -308,7 +308,7 @@ public Photoset getInfo(String photosetId) throws FlickrException { * @param userId * The User id * @return The Photosets collection - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Photosets getList(String userId) throws FlickrException { return getList(userId, 0, 0, null); @@ -324,7 +324,7 @@ public Photosets getList(String userId) throws FlickrException { * @param primaryPhotoExtras * A comma-delimited list of extra information to fetch for the primary photo * @return The Photosets collection - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Photosets getList(String userId, String primaryPhotoExtras) throws FlickrException { return getList(userId, 0, 0, primaryPhotoExtras); @@ -344,7 +344,7 @@ public Photosets getList(String userId, String primaryPhotoExtras) throws Flickr * @param primaryPhotoExtras * A comma-delimited list of extra information to fetch for the primary photo * @return The Photosets collection - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Photosets getList(String userId, int perPage, int page, String primaryPhotoExtras) throws FlickrException { Map parameters = new HashMap(); @@ -435,7 +435,7 @@ public Photosets getList(String userId, int perPage, int page, String primaryPho * @param userId * The User id * @return int The number of photosets - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public int getPhotosetCount(String userId) throws FlickrException { Map parameters = new HashMap(); @@ -481,7 +481,7 @@ public int getPhotosetCount(String userId) throws FlickrException { * @param page * The page offset * @return PhotoList The Collection of Photo objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getPhotos(String photosetId, Set extras, int privacy_filter, int perPage, int page) throws FlickrException { PhotoList photos = new PhotoList(); @@ -547,7 +547,7 @@ public PhotoList getPhotos(String photosetId, Set extras, int pri * @param page * The page offset * @return PhotoList The Collection of Photo objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getPhotos(String photosetId, int perPage, int page) throws FlickrException { return getPhotos(photosetId, Extras.MIN_EXTRAS, Flickr.PRIVACY_LEVEL_NO_FILTER, perPage, page); @@ -560,7 +560,7 @@ public PhotoList getPhotos(String photosetId, int perPage, int page) thro * * @param photosetIds * An array of Ids - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void orderSets(String[] photosetIds) throws FlickrException { Map parameters = new HashMap(); @@ -582,7 +582,7 @@ public void orderSets(String[] photosetIds) throws FlickrException { * The photoset ID * @param photoId * The photo ID - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void removePhoto(String photosetId, String photoId) throws FlickrException { Map parameters = new HashMap(); @@ -604,7 +604,7 @@ public void removePhoto(String photosetId, String photoId) throws FlickrExceptio * The photoset ID * @param photoIds * The ID's of the photos, in CVS format - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void removePhotos(String photosetId, String photoIds) throws FlickrException { Map parameters = new HashMap(); @@ -626,7 +626,7 @@ public void removePhotos(String photosetId, String photoIds) throws FlickrExcept * The photoset ID * @param photoIds * The ID's of the photos, in CSV format, in the order they need to be in. - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void reorderPhotos(String photosetId, String photoIds) throws FlickrException { Map parameters = new HashMap(); @@ -648,7 +648,7 @@ public void reorderPhotos(String photosetId, String photoIds) throws FlickrExcep * The photoset ID * @param photoId * The photo ID that is being added - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void setPrimaryPhoto(String photosetId, String photoId) throws FlickrException { Map parameters = new HashMap(); diff --git a/src/main/java/com/flickr4java/flickr/photosets/comments/PhotosetsCommentsInterface.java b/src/main/java/com/flickr4java/flickr/photosets/comments/PhotosetsCommentsInterface.java index 4b58cf69..651262e0 100644 --- a/src/main/java/com/flickr4java/flickr/photosets/comments/PhotosetsCommentsInterface.java +++ b/src/main/java/com/flickr4java/flickr/photosets/comments/PhotosetsCommentsInterface.java @@ -50,7 +50,7 @@ public PhotosetsCommentsInterface(String apiKey, String sharedSecret, Transport * @param commentText * Text of the comment * @return the comment id - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public String addComment(String photosetId, String commentText) throws FlickrException { Map parameters = new HashMap(); @@ -75,7 +75,7 @@ public String addComment(String photosetId, String commentText) throws FlickrExc * * @param commentId * The id of the comment to delete from a photoset. - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void deleteComment(String commentId) throws FlickrException { Map parameters = new HashMap(); @@ -98,7 +98,7 @@ public void deleteComment(String commentId) throws FlickrException { * The id of the comment to edit. * @param commentText * Update the comment to this text. - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void editComment(String commentId, String commentText) throws FlickrException { Map parameters = new HashMap(); @@ -123,7 +123,7 @@ public void editComment(String commentId, String commentText) throws FlickrExcep * @param photosetId * The id of the photoset to fetch comments for. * @return a list of {@link Comment} objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public List getList(String photosetId) throws FlickrException { Map parameters = new HashMap(); diff --git a/src/main/java/com/flickr4java/flickr/places/PlacesInterface.java b/src/main/java/com/flickr4java/flickr/places/PlacesInterface.java index 75789069..d386c63c 100644 --- a/src/main/java/com/flickr4java/flickr/places/PlacesInterface.java +++ b/src/main/java/com/flickr4java/flickr/places/PlacesInterface.java @@ -151,7 +151,7 @@ public PlacesInterface(String apiKey, String sharedSecret, Transport transportAP * * @param query * @return PlacesList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PlacesList find(String query) throws FlickrException { Map parameters = new HashMap(); @@ -229,7 +229,7 @@ public PlacesList find(String query) throws FlickrException { * The longitude whose valid range is -180 to 180. Anything more than 4 decimal places will be truncated. * @param accuracy * @return A PlacesList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PlacesList findByLatLon(double latitude, double longitude, int accuracy) throws FlickrException { Map parameters = new HashMap(); @@ -271,7 +271,7 @@ public PlacesList findByLatLon(double latitude, double longitude, int acc * @param woeId * A Where On Earth (WOE) ID. Can be null. (While optional, you must pass either a valid Places ID or a WOE ID.) * @return List of Places - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PlacesList getChildrenWithPhotosPublic(String placeId, String woeId) throws FlickrException { Map parameters = new HashMap(); @@ -314,7 +314,7 @@ public PlacesList getChildrenWithPhotosPublic(String placeId, String woeI * @param woeId * A Where On Earth (WOE) ID. Optional, can be null. (While optional, you must pass either a valid Places ID or a WOE ID.) * @return A Location - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Location getInfo(String placeId, String woeId) throws FlickrException { Map parameters = new HashMap(); @@ -344,7 +344,7 @@ public Location getInfo(String placeId, String woeId) throws FlickrException { * * @param url * @return A Location - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Location getInfoByUrl(String url) throws FlickrException { Map parameters = new HashMap(); @@ -368,7 +368,7 @@ public Location getInfoByUrl(String url) throws FlickrException { *

    * * @return A list of placetypes - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public ArrayList getPlaceTypes() throws FlickrException { Map parameters = new HashMap(); @@ -408,7 +408,7 @@ public ArrayList getPlaceTypes() throws FlickrException { * @param woeId * A Where On Earth (WOE) ID. Optional, can be null. * @return A list of shapes - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public ShapeDataList getShapeHistory(String placeId, String woeId) throws FlickrException { ShapeDataList shapeList = new ShapeDataList(); @@ -468,7 +468,7 @@ public ShapeDataList getShapeHistory(String placeId, String woeId) th * @param woeId * A Where On Earth (WOE) ID. Optional, can be null. * @return PlacesList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PlacesList getTopPlacesList(int placeType, Date date, String placeId, String woeId) throws FlickrException { Map parameters = new HashMap(); @@ -525,7 +525,7 @@ public PlacesList getTopPlacesList(int placeType, Date date, String place * @param bbox * @param placeType * @return A PlacesList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PlacesList placesForBoundingBox(int placeType, String bbox) throws FlickrException { Map parameters = new HashMap(); @@ -569,7 +569,7 @@ public PlacesList placesForBoundingBox(int placeType, String bbox) throws * @param contacts * Search your contacts. Either 'all' or 'ff' for just friends and family. (Optional, default is all) * @return A PlacesList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PlacesList placesForContacts(int placeType, String placeId, String woeId, String threshold, String contacts) throws FlickrException { Map parameters = new HashMap(); @@ -638,7 +638,7 @@ public PlacesList placesForContacts(int placeType, String placeId, String * @param maxTakenDate * Optional, can be null. * @return A PlacesList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PlacesList placesForTags(int placeTypeId, String woeId, String placeId, String threshold, String[] tags, String tagMode, String machineTags, String machineTagMode, Date minUploadDate, Date maxUploadDate, Date minTakenDate, Date maxTakenDate) throws FlickrException { @@ -719,7 +719,7 @@ public PlacesList placesForTags(int placeTypeId, String woeId, String pla * @param maxTakenDate * Optional, can be null. * @return A PlacesList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PlacesList placesForUser(int placeType, String woeId, String placeId, String threshold, Date minUploadDate, Date maxUploadDate, Date minTakenDate, Date maxTakenDate) throws FlickrException { @@ -773,7 +773,7 @@ public PlacesList placesForUser(int placeType, String woeId, String place * @deprecated This method has been deprecated. It won't be removed but you should use {@link #getInfo(String, String)} instead. * @param placeId * @return A Location - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ @Deprecated public Location resolvePlaceId(String placeId) throws FlickrException { @@ -800,7 +800,7 @@ public Location resolvePlaceId(String placeId) throws FlickrException { * @deprecated This method has been deprecated. It won't be removed but you should use {@link PlacesInterface#getInfoByUrl(String)} instead. * @param flickrPlacesUrl * @return A Location - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ @Deprecated public Location resolvePlaceURL(String flickrPlacesUrl) throws FlickrException { @@ -837,7 +837,7 @@ public Location resolvePlaceURL(String flickrPlacesUrl) throws FlickrException { * @param maxTakenDate * Optional, can be null. * @return A list of Tags - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public ArrayList tagsForPlace(String woeId, String placeId, Date minUploadDate, Date maxUploadDate, Date minTakenDate, Date maxTakenDate) throws FlickrException { diff --git a/src/main/java/com/flickr4java/flickr/prefs/PrefsInterface.java b/src/main/java/com/flickr4java/flickr/prefs/PrefsInterface.java index a9d10c8b..43b6bb6f 100644 --- a/src/main/java/com/flickr4java/flickr/prefs/PrefsInterface.java +++ b/src/main/java/com/flickr4java/flickr/prefs/PrefsInterface.java @@ -56,7 +56,7 @@ public PrefsInterface(String apiKey, String sharedSecret, Transport transportAPI * @see com.flickr4java.flickr.Flickr#CONTENTTYPE_PHOTO * @see com.flickr4java.flickr.Flickr#CONTENTTYPE_SCREENSHOT * @return The content-type - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public String getContentType() throws FlickrException { Map parameters = new HashMap(); @@ -75,7 +75,7 @@ public String getContentType() throws FlickrException { * Returns the default privacy level for geographic information attached to the user's photos. * * @return privacy-level - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_NO_FILTER * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_PUBLIC * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_FRIENDS @@ -107,7 +107,7 @@ public int getGeoPerms() throws FlickrException { * Returns the default hidden preference for the user. * * @return boolean hidden or not - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public boolean getHidden() throws FlickrException { Map parameters = new HashMap(); @@ -129,7 +129,7 @@ public boolean getHidden() throws FlickrException { * @see com.flickr4java.flickr.Flickr#SAFETYLEVEL_RESTRICTED * @see com.flickr4java.flickr.Flickr#SAFETYLEVEL_SAFE * @return The current users safety-level - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public String getSafetyLevel() throws FlickrException { Map parameters = new HashMap(); @@ -153,7 +153,7 @@ public String getSafetyLevel() throws FlickrException { * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_FRIENDS_FAMILY * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_FAMILY * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_FRIENDS - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * @return privacyLevel */ public int getPrivacy() throws FlickrException { diff --git a/src/main/java/com/flickr4java/flickr/reflection/ReflectionInterface.java b/src/main/java/com/flickr4java/flickr/reflection/ReflectionInterface.java index cb5a840d..002dfbd9 100644 --- a/src/main/java/com/flickr4java/flickr/reflection/ReflectionInterface.java +++ b/src/main/java/com/flickr4java/flickr/reflection/ReflectionInterface.java @@ -59,7 +59,7 @@ public ReflectionInterface(String apiKey, String sharedSecret, Transport transpo * @param methodName * The method name * @return The Method object - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Method getMethodInfo(String methodName) throws FlickrException { Map parameters = new HashMap(); @@ -177,7 +177,7 @@ public Method getMethodInfo(String methodName) throws FlickrException { * Get a list of all methods. * * @return The method names - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection getMethods() throws FlickrException { Map parameters = new HashMap(); diff --git a/src/main/java/com/flickr4java/flickr/stats/StatsInterface.java b/src/main/java/com/flickr4java/flickr/stats/StatsInterface.java index d1abbf9d..59055b80 100644 --- a/src/main/java/com/flickr4java/flickr/stats/StatsInterface.java +++ b/src/main/java/com/flickr4java/flickr/stats/StatsInterface.java @@ -133,7 +133,7 @@ public Stats getCollectionStats(String collectionId, Date date) throws FlickrExc /** * Returns a list of URLs for text files containing all your stats data (from November 26th 2007 onwards) for the currently auth'd user. * - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * * @see "http://www.flickr.com/services/api/flickr.stats.getCSVFiles.html" */ @@ -315,7 +315,7 @@ public Stats getPhotostreamStats(Date date) throws FlickrException { * (Optional) Number of referrers to return per page. If this argument is omitted, it defaults to 25. The maximum allowed value is 100. * @param page * (Optional) The page of results to return. If this argument is omitted, it defaults to 1. - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * @see "http://www.flickr.com/services/api/flickr.stats.getPopularPhotos.html" */ public PhotoList getPopularPhotos(Date date, StatsSort sort, int perPage, int page) throws FlickrException { @@ -344,7 +344,7 @@ public PhotoList getPopularPhotos(Date date, StatsSort sort, int perPage, * @param date * (Optional) Stats will be returned for this date. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will * automatically be rounded down to the start of the day. If no date is provided, all time view counts will be returned. - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr * * @see "http://www.flickr.com/services/api/flickr.stats.getTotalViews.html" */ diff --git a/src/main/java/com/flickr4java/flickr/tags/TagsInterface.java b/src/main/java/com/flickr4java/flickr/tags/TagsInterface.java index 6be21e2f..53f2683c 100644 --- a/src/main/java/com/flickr4java/flickr/tags/TagsInterface.java +++ b/src/main/java/com/flickr4java/flickr/tags/TagsInterface.java @@ -116,7 +116,7 @@ public ClusterList getClusters(String searchTag) throws FlickrException { * @param tag * @param clusterId * @return PhotoList - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public PhotoList getClusterPhotos(String tag, String clusterId) throws FlickrException { @@ -239,7 +239,7 @@ public Photo getListPhoto(String photoId) throws FlickrException { * @param userId * The User ID * @return The User object - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection getListUser(String userId) throws FlickrException { @@ -277,7 +277,7 @@ public Collection getListUser(String userId) throws FlickrException { * @param userId * The user ID * @return The collection of Tag objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection getListUserPopular(String userId) throws FlickrException { @@ -314,7 +314,7 @@ public Collection getListUserPopular(String userId) throws FlickrException *

    * * @return The collection of Tag objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection getListUserRaw() throws FlickrException { @@ -332,7 +332,7 @@ public Collection getListUserRaw() throws FlickrException { * a tag to search for (optional) * * @return The collection of Tag objects - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection getListUserRaw(String tagVal) throws FlickrException { @@ -377,7 +377,7 @@ public Collection getListUserRaw(String tagVal) throws FlickrException { * @param tag * The source tag * @return A RelatedTagsList object - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public RelatedTagsList getRelated(String tag) throws FlickrException { diff --git a/src/main/java/com/flickr4java/flickr/test/TestInterface.java b/src/main/java/com/flickr4java/flickr/test/TestInterface.java index a51b4270..82a3bd5a 100644 --- a/src/main/java/com/flickr4java/flickr/test/TestInterface.java +++ b/src/main/java/com/flickr4java/flickr/test/TestInterface.java @@ -45,7 +45,7 @@ public TestInterface(String apiKey, String sharedSecret, Transport transportAPI) * @param params * The parameters * @return The Collection of echoed elements - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Collection echo(Map params) throws FlickrException { Map parameters = new HashMap(); @@ -64,7 +64,7 @@ public Collection echo(Map params) throws FlickrExcepti * A testing method which checks if the caller is logged in then returns a User object. * * @return The User object - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public User login() throws FlickrException { Map parameters = new HashMap(); @@ -87,7 +87,7 @@ public User login() throws FlickrException { /** * Null test. This method requires authentication with 'read' permission. * - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public void null_() throws FlickrException { Map parameters = new HashMap(); diff --git a/src/main/java/com/flickr4java/flickr/uploader/Uploader.java b/src/main/java/com/flickr4java/flickr/uploader/Uploader.java index b13a53ff..accc7ce2 100644 --- a/src/main/java/com/flickr4java/flickr/uploader/Uploader.java +++ b/src/main/java/com/flickr4java/flickr/uploader/Uploader.java @@ -69,7 +69,7 @@ public Uploader(String apiKey, String sharedSecret, Transport transport) { * @param metaData * The meta data * @return photoId or ticketId - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ @Override public String upload(byte[] data, UploadMetaData metaData) throws FlickrException { @@ -85,7 +85,7 @@ public String upload(byte[] data, UploadMetaData metaData) throws FlickrExceptio * @param metaData * The meta data * @return photoId or ticketId - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ @Override public String upload(File file, UploadMetaData metaData) throws FlickrException { @@ -99,7 +99,7 @@ public String upload(File file, UploadMetaData metaData) throws FlickrException * @param in * @param metaData * @return photoId or ticketId - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ @Override public String upload(InputStream in, UploadMetaData metaData) throws FlickrException { @@ -112,7 +112,7 @@ public String upload(InputStream in, UploadMetaData metaData) throws FlickrExcep * * @param in * @return photoId or ticketId - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ @Override public String replace(InputStream in, String flickrId, boolean async) throws FlickrException { @@ -127,7 +127,7 @@ public String replace(InputStream in, String flickrId, boolean async) throws Fli * @param flickrId * @param async * @return photoId or ticketId - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ @Override public String replace(byte[] data, String flickrId, boolean async) throws FlickrException { @@ -142,7 +142,7 @@ public String replace(byte[] data, String flickrId, boolean async) throws Flickr * @param flickrId * @param async * @return photoId or ticketId - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ @Override public String replace(File file, String flickrId, boolean async) throws FlickrException { diff --git a/src/main/java/com/flickr4java/flickr/urls/UrlsInterface.java b/src/main/java/com/flickr4java/flickr/urls/UrlsInterface.java index 5ba2b45e..80948eb5 100644 --- a/src/main/java/com/flickr4java/flickr/urls/UrlsInterface.java +++ b/src/main/java/com/flickr4java/flickr/urls/UrlsInterface.java @@ -60,7 +60,7 @@ public UrlsInterface(String apiKey, String sharedSecret, Transport transportAPI) * @param groupId * The group ID * @return The group URL - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public String getGroup(String groupId) throws FlickrException { Map parameters = new HashMap(); @@ -83,7 +83,7 @@ public String getGroup(String groupId) throws FlickrException { * @param userId * The user ID * @return The user photo URL - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public String getUserPhotos(String userId) throws FlickrException { Map parameters = new HashMap(); @@ -106,7 +106,7 @@ public String getUserPhotos(String userId) throws FlickrException { * @param userId * The user ID * @return The URL - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public String getUserProfile(String userId) throws FlickrException { Map parameters = new HashMap(); @@ -129,7 +129,7 @@ public String getUserProfile(String userId) throws FlickrException { * @param url * The url * @return The group - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Group lookupGroup(String url) throws FlickrException { Map parameters = new HashMap(); @@ -156,7 +156,7 @@ public Group lookupGroup(String url) throws FlickrException { * @param url * The user profile URL * @return The username - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public String lookupUser(String url) throws FlickrException { Map parameters = new HashMap(); @@ -180,7 +180,7 @@ public String lookupUser(String url) throws FlickrException { * @param galleryId * The user profile URL * @return The Gallery - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ public Gallery lookupGallery(String galleryId) throws FlickrException { diff --git a/src/test/java/com/flickr4java/flickr/test/Flickr4JavaTest.java b/src/test/java/com/flickr4java/flickr/test/Flickr4JavaTest.java index 89f5c189..fc2d5316 100644 --- a/src/test/java/com/flickr4java/flickr/test/Flickr4JavaTest.java +++ b/src/test/java/com/flickr4java/flickr/test/Flickr4JavaTest.java @@ -26,7 +26,7 @@ public class Flickr4JavaTest { protected TestProperties testProperties; /** - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ @Before public void setUp() throws FlickrException { diff --git a/src/test/java/com/flickr4java/flickr/test/UploaderTest.java b/src/test/java/com/flickr4java/flickr/test/UploaderTest.java index 9687e4a8..be0383a3 100644 --- a/src/test/java/com/flickr4java/flickr/test/UploaderTest.java +++ b/src/test/java/com/flickr4java/flickr/test/UploaderTest.java @@ -22,7 +22,7 @@ public class UploaderTest extends Flickr4JavaTest { * Test photo uploading using a byte array. * * @throws IOException - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ @Test public void testUploadByteArray() throws IOException, FlickrException { @@ -58,7 +58,7 @@ public void testUploadByteArray() throws IOException, FlickrException { * Test photo upload using an InputStream. * * @throws IOException - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ @Test public void testUploadInputStream() throws IOException, FlickrException { @@ -95,7 +95,7 @@ public void testUploadInputStream() throws IOException, FlickrException { * Test photo replace using an InputStream. * * @throws IOException - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ @Test public void testReplaceInputStream() throws IOException, FlickrException { @@ -145,7 +145,7 @@ public void testReplaceInputStream() throws IOException, FlickrException { * Test photo replace using a byte array. * * @throws IOException - * @throws FlickrException + * @throws FlickrException if there was a problem connecting to Flickr */ @Test public void testReplaceByteArray() throws IOException, FlickrException {