title: Delete files from blobstore using file serving URL
body: <p>In my app (GWT on GAE) we are storing on our database the serving URL that is stored on blobstore. When user selects one of these files and clicks "delete", we need to delete the file from blobstore.</p>
  
  <p>This is our code, but it is not deleting the file at all:</p>
  
  <pre><code>public void remove(String fileURL)
  {
      BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
      String key = getBlobKeyFromURL(fileURL);
      BlobKey blobKey = new BlobKey(key);
      blobstoreService.delete(blobKey);
  }
  </code></pre>
  
  <p>Where <code>fileURL</code> looks like this:</p>
  
  <pre><code>http://lh6.ggpht.com/d5VC0ywISACeJRiC3zkzaZug-tPsaI_LGt93-e_ATGTCwnGLao4yTWjLVppQ
  </code></pre>
  
  <p>And <code>getBlobKeyFromURL()</code> would return what is after the last "/", in this example:</p>
  
  <pre><code>d5VC0ywISACeJRiC3zkzaZug-tPsaI_LGt93-e_ATGTCwnGLao4yTWjLVppQ
  </code></pre>
  
  <p>*<strong><em>EDIT:</em>*</strong> Seems that what getBlobKeyFromURL() returns is not the blobKey. The blobKey is a different string that, with <code>/download?blob-key=</code> before, returns the <code>fileURL</code>. So the question now would be: <strong>how can I get the blobKey from the URL?</strong></p>
  
  <p>Could you please advice?</p>
  
  <p>Thanks</p>