title: Deleting orphan blobs in appengine blobstore
body: <p>I deleted a large number of objects from the datastore that I din't 
  require (around 7000 of them). 
  Each of those objects had a blob associated with it, referenced by a 
  String (blob key). <br/><br/>
  As you might have guessed by now, I forgot to delete those blobs. 
  Now I don't have any reference to them, but I want to delete them. 
  I can't seem to find a way to do that. 
  Any help will be appreciated.<br/><br/>
  <strong>UPDATE</strong>
  Found the solution.</p>
  
  <pre><code>DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
  BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
  List&lt;BlobInfo&gt; blobsToCheck = new LinkedList&lt;BlobInfo&gt;(); 
  Iterator&lt;BlobInfo&gt; iterator = null;
  if(afterBlobKey == null){
      iterator = new BlobInfoFactory().queryBlobInfos();
  }else{
      iterator = new BlobInfoFactory().queryBlobInfosAfter(new BlobKey(afterBlobKey));
  }
  
  while(iterator.hasNext()){
  
      blobsToCheck.add(iterator.next());
  
  }
  
  //Check those blobs if they have reference in datastore
  //Delete using blobstoreService.delete(blobKey);
  </code></pre>