@@ -0,0 +1,1918 @@
+package com.google.sps.servlets;%0A%0Aimport com.google.cloud.tasks.v2.AppEngineHttpRequest;%0Aimport com.google.cloud.tasks.v2.CloudTasksClient;%0Aimport com.google.cloud.tasks.v2.HttpMethod;%0Aimport com.google.cloud.tasks.v2.QueueName;%0Aimport com.google.cloud.tasks.v2.Task;%0Aimport com.google.protobuf.ByteString;%0Aimport com.google.sps.workspace.Workspace;%0Aimport com.google.sps.workspace.WorkspaceFactory;%0Aimport java.io.IOException;%0Aimport java.nio.charset.Charset;%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.annotation.WebServlet;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0A@WebServlet(%22/workspace/queueDownload%22)%0Apublic class QueueDownload extends HttpServlet %7B%0A  WorkspaceFactory workspaceFactory = WorkspaceFactory.getInstance();%0A%0A  @Override%0A  protected void doGet(HttpServletRequest req, HttpServletResponse resp)%0A      throws ServletException, IOException %7B%0A    Workspace w = workspaceFactory.fromWorkspaceID(req.getParameter(%22workspaceID%22));%0A%0A    String downloadID = w.newDownloadID();%0A%0A    try (CloudTasksClient client = CloudTasksClient.create()) %7B%0A      String queuePath =%0A          QueueName.of(%22fulfillment-deco-step-2020%22, %22us-central1%22, %22download-queue%22).toString();%0A%0A      Task.Builder taskBuilder =%0A          Task.newBuilder()%0A              .setAppEngineHttpRequest(%0A                  AppEngineHttpRequest.newBuilder()%0A                      .setBody(%0A                          ByteString.copyFrom(%0A                              String.join(%22,%22, w.getWorkspaceID(), downloadID),%0A                              Charset.defaultCharset()))%0A                      .setRelativeUri(%22/tasks/prepareDownload%22)%0A                      .setHttpMethod(HttpMethod.POST)%0A                      .build());%0A%0A      client.createTask(queuePath, taskBuilder.build());%0A%0A      resp.getWriter().print(downloadID);%0A    %7D%0A  %7D%0A%7D%0A

Add servlet to queue a download.