}
String productDirPath = getContextWorkingDir().getCanonicalPath()
+ "/" + datasetName;
DatasetResource resource = new DatasetResource(datasetId, datasetName,
datasetMetadata, getContextWorkingDir());
// Add all products of the chosen type(s) to the dataset.
for (ProductType productType : productTypes)
{
for (Product product : client.getProductsByProductType(productType))
{
product.setProductReferences(client.getProductReferences(product));
resource.addProductResource(new ProductResource(product,
client.getMetadata(product), product.getProductReferences(),
new File(productDirPath)));
}
}
return resource;