Reputation: 6884
I try to integrate the upload of video with Brightcove in Java:
http://support.brightcove.com/en/docs/java-example-upload-video
But with GAE we cannot write on disk so I got the following exception:
java.lang.NoClassDefFoundError: java.rmi.server.UID is a restricted class. Please see the Google App Engine developer's guide for more details.
The exception occurs at this line: (UploadVideo.java)
// Parse the request into a list of DiskFileItems
List items = upload.parseRequest(request);
Because it's trying to use org.apache.commons.fileupload.disk.*
which will not work with GAE.
I'm looking for a way around this. Looks like it might be really tricky so i'm open to any suggestions
Upvotes: 0
Views: 162
Reputation: 1769
One common approach is to use the BlobStore. See: https://developers.google.com/appengine/docs/java/blobstore/overview
The idea is: Provide the blobstore-created upload URL via your webpage's form (i.e. the "uploading using an HTML form" section of the brightcove example). The blobstore's createUploadUrl function takes an argument that is a callback URL... I.e. after the file is uploaded and stored into the BlobStore, GAE will request your callback URL. In that request, you can send the video blob to Brightcove via JSON (or, perhaps better, spawn a Task to send it to Brightcove).
Google Cloud Storage is another option, see: https://developers.google.com/appengine/docs/java/googlestorage/overview
Instead of writing to a file, you would write to Cloud Storage request stream.
Upvotes: 1