@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<String, String> uploadParameters = new HashMap<>(metaData.getUploadParameters());
buildMultipartRequest(uploadParameters, request);
OAuth10aService service = createAndSignRequest(apiKey, sharedSecret, request);
uploadParameters.putAll(request.getOauthParameters());
request.addMultipartPayload(String.format("form-data; name=\"photo\"; filename=\"%s\"", metaData.getFilename()), metaData.getFilemimetype(), payload.getPayload());
uploadParameters.entrySet().forEach(e ->
request.addMultipartPayload(String.format("form-data; name=\"%s\"", e.getKey()), null, e.getValue().getBytes()));
try {
return handleResponse(request, service);
} catch (IllegalAccessException | InterruptedException | ExecutionException | InstantiationException | IOException | SAXException | ParserConfigurationException e) {
throw new FlickrRuntimeException(e);
}
}