* @throws SAXException
*/
public String upload(byte[] data, UploadMetaData metaData) throws FlickrException, IOException, SAXException {
List parameters = new ArrayList();
parameters.add(new Parameter("api_key", apiKey));
String title = metaData.getTitle();
if (title != null)
parameters.add(new Parameter("title", title));
String description = metaData.getDescription();
if (description != null)
parameters.add(new Parameter("description", description));
Collection tags = metaData.getTags();
if (tags != null)
parameters.add(new Parameter("tags", StringUtilities.join(tags, " ")));
parameters.add(new Parameter("is_public", metaData.isPublicFlag() ? "1" : "0"));
parameters.add(new Parameter("is_family", metaData.isFamilyFlag() ? "1" : "0"));
parameters.add(new Parameter("is_friend", metaData.isFriendFlag() ? "1" : "0"));
parameters.add(new Parameter("photo", data));
if (metaData.isHidden() != null) {
parameters.add(new Parameter("hidden", metaData.isHidden().booleanValue() ? "1" : "0"));
}
if (metaData.getSafetyLevel() != null) {
parameters.add(new Parameter("safety_level", metaData.getSafetyLevel()));
}
parameters.add(new Parameter("async", metaData.isAsync() ? "1" : "0"));
if (metaData.getContentType() != null) {
parameters.add(new Parameter("content_type", metaData.getContentType()));
}
parameters.add(
new Parameter(
"api_sig",
AuthUtilities.getMultipartSignature(sharedSecret, parameters)
)
);