public void editPhotos(String strGalleryId, String strPrimaryPhotoId, String strPhotoIds) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_EDIT_PHOTOS); parameters.put("gallery_id", strGalleryId); parameters.put("primary_photo_id", strPrimaryPhotoId); parameters.put("photo_ids", strPhotoIds); Response response = transport.post(transport.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
public void addPhoto(String strGalleryId, String photoId, String strComment) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_ADD_PHOTO); parameters.put("gallery_id", strGalleryId); parameters.put("photo_id", photoId); parameters.put("comment", strComment); Response response = transport.post(transport.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
public void editPhoto(String strGalleryId, String strPhotoId, String strComment) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_EDIT_PHOTO); parameters.put("gallery_id", strGalleryId); parameters.put("photo_id", strPhotoId); parameters.put("comment", strComment); Response response = transport.post(transport.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
public void addPhoto(String strGalleryId, String photoId, String strComment) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_ADD_PHOTO); parameters.put("gallery_id", strGalleryId); parameters.put("photo_id", photoId); parameters.put("comment", strComment); Response response = transport.post(transport.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
public void editPhoto(String strGalleryId, String strPhotoId, String strComment) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_EDIT_PHOTO); parameters.put("gallery_id", strGalleryId); parameters.put("photo_id", strPhotoId); parameters.put("comment", strComment); Response response = transport.post(transport.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
public void editPhotos(String strGalleryId, String strPrimaryPhotoId, String strPhotoIds) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_EDIT_PHOTOS); parameters.put("gallery_id", strGalleryId); parameters.put("primary_photo_id", strPrimaryPhotoId); parameters.put("photo_ids", strPhotoIds); Response response = transport.post(transport.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
public void editMeta(String strGalleryId, String strTitle, String strDescription) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_EDIT_META); parameters.put("title", strTitle); parameters.put("description", strDescription); Response response = transport.post(transport.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
public void editMeta(String strGalleryId, String strTitle, String strDescription) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_EDIT_META); parameters.put("title", strTitle); parameters.put("description", strDescription); Response response = transport.post(transport.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()); } }
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 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 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 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; }
/** * Remove the specified photo from the user's favorites. * * @param photoId * The photo id */ public void remove(String photoId) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_REMOVE); parameters.put("photo_id", photoId); Response response = transportAPI.post(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
/** * Add a photo to the user's favorites. * * @param photoId * The photo ID * @throws FlickrException */ public void add(String photoId) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_ADD); parameters.put("photo_id", photoId); Response response = transportAPI.post(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
/** * Delete the specified photoset. * * @param photosetId * The photoset ID * @throws FlickrException */ public void delete(String photosetId) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_DELETE); parameters.put("photoset_id", photosetId); Response response = transportAPI.post(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
/** * Delete the specified note. * * @param noteId * The node ID * @throws FlickrException */ public void delete(String noteId) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_DELETE); parameters.put("note_id", noteId); Response response = transportAPI.post(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
/** * 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; }
/** * 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()); } }