public void doGet(HttpServletRequest req,
HttpServletResponse resp)
throws IOException, ServletException {
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
String loginUrl = userService.createLoginURL("/");
String logoutUrl = userService.createLogoutURL("/");
BlobstoreService blobstoreService =
BlobstoreServiceFactory.getBlobstoreService();
UploadOptions uploadOptions = UploadOptions.Builder
.withMaxUploadSizeBytesPerBlob(1024L * 1024L * 1024L)
.maxUploadSizeBytes(10L * 1024L * 1024L * 1024L);
String uploadUrl = blobstoreService.createUploadUrl("/upload", uploadOptions);
DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
BlobInfoFactory blobInfoFactory = new BlobInfoFactory();
List<Map<String, Object>> uploads = new ArrayList<Map<String, Object>>();
Key userGroupKey = KeyFactory.createKey("UserUploadGroup", user.getEmail());
Query q = new Query("UserUpload").setAncestor(userGroupKey);
q.addFilter("user", Query.FilterOperator.EQUAL, user);
PreparedQuery pq = ds.prepare(q);
Iterable<Entity> results = pq.asIterable();
for (Entity result : results) {