Hi,
I am able to extract the list of Package Delivery Id in JAVA but cannot find any API for downloading the files. In the REST API Reference tree Section, I found the following C# code for downloading the files. Can someone provide the download the package deliveries code in JAVA for a given PackageDeliveryId ?
var StandardExtractionsContext = new StandardExtractionsContext(new Uri("https://hosted.datascopeapi.reuters.com/RestApi/v1/"), "<your user id>", "<your password>");
//Returns the list of all available subscriptions.
var subscriptions = StandardExtractionsContext.SubscriptionOperations.GetAll();
//Output
var fromDate = DateTime.UtcNow.AddDays(-1);
var toDate = DateTime.UtcNow.AddDays(1);
foreach (var subscription in subscriptions.Take(1)) {
//Returns the list of package deliveries for which this user has permissions for a specific subscription and a range of dates.
var userPackageDeliveries = StandardExtractionsContext.UserPackageDeliveryOperations.GetUserPackageDeliveriesByDateRange(subscription.SubscriptionId, fromDate, toDate);
//Output
foreach (var userPackageDelivery in userPackageDeliveries) {
Debug.WriteLine("{0} ({1} bytes)", userPackageDelivery.Name, userPackageDelivery.FileSizeBytes);
using (var response = StandardExtractionsContext.UserPackageDeliveryOperations.GetReadStream(userPackageDelivery.PackageDeliveryId)) {
using (var fileStream = File.Create("..\\" + userPackageDelivery.Name))
response.Stream.CopyToAsync(fileStream).Wait();
}
}
}