Yes!! This is my implementation:
public class Serve extends HttpServlet { private static final long serialVersionUID = 5603629129606331547L; public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException { BlobKey blobKey = new BlobKey(req.getParameter("blob-key")); BlobstoreServiceFactory.getBlobstoreService().serve(blobKey, res); } }
.. and this is web.xml:
<servlet> <servlet-name>Serve</servlet-name> <servlet-class><my-package>.Serve</servlet-class> </servlet> <servlet-mapping> <servlet-name>Serve</servlet-name> <url-pattern>/serve</url-pattern> </servlet-mapping>
note that the βdirect urlβ (getServingUrl, I think you mean) exists only for images: https://developers.google.com/appengine/docs/java/images/overview#Transforming_Images_from_the_Blobstore
source share