package com.google.sps.servlets;

import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.EntityNotFoundException;
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;
import java.io.IOException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/** Servlet responsible for deleting recipes. */
@WebServlet("/delete-recipe")
public class DeleteRecipeServlet extends HttpServlet {

  @Override
  public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
    long id = Long.parseLong(request.getParameter("id"));

    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();

    // delete the private recipe
    Key key = KeyFactory.createKey("Recipe", id);
    datastore.delete(key);

    // TODO: delete blobs too
  }
}

@@ -158,125 +158,8 @@
 ry;%0A
-import com.google.appengine.api.datastore.Entity;%0Aimport com.google.appengine.api.datastore.EntityNotFoundException;%0A
 impo
@@ -869,16 +869,8 @@
 the 
-private 
 reci

remove unnecessary imports