* @throws IOException if an I/O error occurs while reading the passed
* file
*/
public static Request uploadVideo(MediaItem item, File content) throws
RequestException, IOException {
Request request = uploadMediaItem(item, content);
// Add REST query string parameters
request.addRestQueryStringParameter("type", "video");
if (item.getCaption() != null) {
request.addRestQueryStringParameter("caption", item.getCaption());
}
if (item.getDescription() != null) {
request.addRestQueryStringParameter("description",
item.getDescription());
}
if (item.hasField("msCategories")) {
request.addRestQueryStringParameter("msCategories",
item.getFieldAsString("msCategories"));
}
if (item.hasField("language")) {
request.addRestQueryStringParameter("language",
item.getFieldAsString("language"));
}
if (item.hasField("tags")) {
request.addRestQueryStringParameter("tags",
item.getFieldAsString("tags"));
}
return request;
}