// Get DfpUser from "~/dfp.properties".
DfpUser user = new DfpUser();
// Get InventoryService.
InventoryServiceInterface inventoryService =
user.getService(DfpService.V201308.INVENTORY_SERVICE);
// Create statement object to only select web ad unit sizes.
Statement filterStatement = new StatementBuilder("WHERE targetPlatform = :targetPlatform")
.putValue("targetPlatform", TargetPlatform.WEB.toString()).toStatement();
// Get all ad unit sizes.
AdUnitSize[] adUnitSizes = inventoryService.getAdUnitSizesByStatement(filterStatement);
// Display results.
if (adUnitSizes != null) {
for (int i = 0; i < adUnitSizes.length; i++) {
AdUnitSize adUnitSize = adUnitSizes[i];