Query query = pm.newQuery(ProfilePicture.class);
query.setFilter("md5 == fieldParam");
query.declareParameters("String fieldParam");
query.setRange(0, 1);
ProfilePicture pp = CollUtils.getOneOrNull(Utils.<Collection<ProfilePicture>>cast(query.execute(pictureMd5)));
if (pp == null)
throw new IllegalArgumentException("Invalid token");
final byte[] image = pp.getPicture().getBytes();
return new BinaryDataPostAction() {
@Override protected boolean isCacheForever() {
return true;
}