@@ -0,0 +1,2132 @@
+%0Aimport com.google.appengine.api.datastore.DatastoreService;%0Aimport com.google.appengine.api.datastore.DatastoreServiceFactory;%0Aimport com.google.appengine.api.datastore.Entity;%0Aimport com.google.appengine.api.datastore.PreparedQuery;%0Aimport com.google.appengine.api.datastore.Query;%0Aimport com.google.gson.Gson;%0Apackage com.google.sps;%0Aimport com.google.sps.data.Fields;%0Aimport com.google.sps.data.Video;%0Aimport javax.servlet.annotation.WebServlet;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0Aimport java.io.IOException;%0Aimport java.io.File;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Paths;%0A%0A// Servlet for testing queries.%0A@WebServlet(%22/data%22)%0Apublic class DataServlet extends HttpServlet %7B%0A%0A    @Override%0A    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException%7B%0A        return;%0A    %7D%0A%0A      @Override%0A    public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException %7B%0A       %0A        Video video = requestToVideoObject(request);%0A        Entity videoEntity = videoToEntity(video);%0A%0A        DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();%0A        datastore.put(videoEntity);%0A        response.sendRedirect(%22/%22);%0A    %7D%0A%0A    public Video requestToVideoObject(HttpServletRequest request)%7B%0A        // Get the input from the form.%0A        String videoId = request.getParameter(Fields.VIDEO_ID);%0A        // Extra fields in form for metadata until we can fetch them.%0A        String title = request.getParameter(Fields.TITLE);%0A        String description = request.getParameter(Fields.DESCRIPTION);%0A        String captions = request.getParameter(Fields.CAPTIONS);%0A        Video video = new Video(videoId, title, description, captions);%0A        return video;%0A    %7D%0A%0A    public Entity videoToEntity(Video video)%7B%0A        Entity videoEntity = new Entity(%22Video%22);%0A        videoEntity.setProperty(%22videoId%22, video.getVideoId());%0A        videoEntity.setProperty(%22videoObjectAsJSON%22, new Gson().toJson(video));%0A        return videoEntity;%0A    %7D%0A%7D

Add Data Servlet, handles putting video data into DataStore