}
private static Request uploadMediaItem(MediaItem item, File content) throws
RequestException, IOException {
if (item.getAlbumId() == null || item.getAlbumId().equals("")) {
throw new RequestException("Passed MediaItem object does not have " +
"album_id property set");
}
if (item.getMimeType() == null || item.getMimeType().equals("")) {
throw new RequestException("Passed MediaItem object does not have " +
"mime_type property set");
}
Request request = new Request(restTemplate, "mediaItems.create", "POST");
request.addComponent(Request.ALBUM_ID, item.getAlbumId());