private void act(String suggestionId, String method) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", method); parameters.put("suggestion_id", suggestionId); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
private void act(String suggestionId, String method) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", method); parameters.put("suggestion_id", suggestionId); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
/** * Null test. This method requires authentication with 'read' permission. * * @throws FlickrException */ public void null_() throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_NULL); Response response = transport.get(transport.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
/** * Null test. This method requires authentication with 'read' permission. * * @throws FlickrException */ public void null_() throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_NULL); Response response = transport.get(transport.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
/** * Delete the person from the photo * * @param photoId * @param userId * @throws FlickrException */ public void delete(String photoId, String userId) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_DELETE); parameters.put("photo_id", photoId); parameters.put("user_id", userId); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
/** * Delete the co-ordinates that the user is shown in * * @param photoId * @param userId * @throws FlickrException */ public void deleteCoords(String photoId, String userId) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_DELETE_COORDS); parameters.put("photo_id", photoId); parameters.put("user_id", userId); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
/** * Delete the co-ordinates that the user is shown in * * @param photoId * @param userId * @throws FlickrException */ public void deleteCoords(String photoId, String userId) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_DELETE_COORDS); parameters.put("photo_id", photoId); parameters.put("user_id", userId); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
private Stats getStats(String method, String idKey, String idValue, Date date) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", method); parameters.put("date", String.valueOf(date.getTime() / 1000L)); if (idValue != null) { parameters.put(idKey, idValue); } Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } Stats stats = parseStats(response.getPayload()); return stats; }
/** * Delete the person from the photo * * @param photoId * @param userId * @throws FlickrException */ public void delete(String photoId, String userId) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_DELETE); parameters.put("photo_id", photoId); parameters.put("user_id", userId); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
private Stats getStats(String method, String idKey, String idValue, Date date) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", method); parameters.put("date", String.valueOf(date.getTime() / 1000L)); if (idValue != null) { parameters.put(idKey, idValue); } Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } Stats stats = parseStats(response.getPayload()); return stats; }
private ReferrerList getReferrers(String method, String domain, String idKey, String idValue, Date date, int perPage, int page) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", method); parameters.put("domain", domain); parameters.put("date", String.valueOf(date.getTime() / 1000L)); if (idValue != null) { parameters.put(idKey, idValue); } addPaginationParameters(parameters, perPage, page); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } ReferrerList referrers = parseReferrers(response); return referrers; }
private ReferrerList getReferrers(String method, String domain, String idKey, String idValue, Date date, int perPage, int page) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", method); parameters.put("domain", domain); parameters.put("date", String.valueOf(date.getTime() / 1000L)); if (idValue != null) { parameters.put(idKey, idValue); } addPaginationParameters(parameters, perPage, page); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } ReferrerList referrers = parseReferrers(response); return referrers; }
private DomainList getDomains(String method, String idKey, String idValue, Date date, int perPage, int page) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", method); parameters.put("date", String.valueOf(date.getTime() / 1000L)); if (idValue != null) { parameters.put(idKey, idValue); } addPaginationParameters(parameters, perPage, page); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } DomainList domains = parseDomains(response); return domains; }
/** * Returns the default hidden preference for the user. * * @return boolean hidden or not * @throws FlickrException */ public boolean getHidden() throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_GET_HIDDEN); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } Element personElement = response.getPayload(); return personElement.getAttribute("hidden").equals("1") ? true : false; }
/** * Returns the default hidden preference for the user. * * @return boolean hidden or not * @throws FlickrException */ public boolean getHidden() throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_GET_HIDDEN); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } Element personElement = response.getPayload(); return personElement.getAttribute("hidden").equals("1") ? true : false; }
private DomainList getDomains(String method, String idKey, String idValue, Date date, int perPage, int page) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", method); parameters.put("date", String.valueOf(date.getTime() / 1000L)); if (idValue != null) { parameters.put(idKey, idValue); } addPaginationParameters(parameters, perPage, page); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } DomainList domains = parseDomains(response); return domains; }
/** * Get the URL for the user's profile. * * @param userId * The user ID * @return The URL * @throws FlickrException */ public String getUserProfile(String userId) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_GET_USER_PROFILE); parameters.put("user_id", userId); Response response = transport.get(transport.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } Element payload = response.getPayload(); return payload.getAttribute("url"); }
/** * Returns the default content type preference for the user. * * @see com.flickr4java.flickr.Flickr#CONTENTTYPE_OTHER * @see com.flickr4java.flickr.Flickr#CONTENTTYPE_PHOTO * @see com.flickr4java.flickr.Flickr#CONTENTTYPE_SCREENSHOT * @return The content-type * @throws FlickrException */ public String getContentType() throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_GET_CONTENT_TYPE); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } Element personElement = response.getPayload(); return personElement.getAttribute("content_type"); }
/** * 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 * * @see "http://www.flickr.com/services/api/flickr.stats.getCSVFiles.html" */ public List<Csv> getCSVFiles() throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_GET_CSV_FILES); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } List<Csv> csvFiles = parseCsvFiles(response); return csvFiles; }
/** * 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 * * @see "http://www.flickr.com/services/api/flickr.stats.getCSVFiles.html" */ public List<Csv> getCSVFiles() throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_GET_CSV_FILES); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } List<Csv> csvFiles = parseCsvFiles(response); return csvFiles; }