icloud4j
icloud4j copied to clipboard
Handling packages from the DriveNode class≈
When the stored objet is a package (eg a Capture one package), the result does not contain a data_token object but a package object (package_token), which also contains a URL.
Map<String, Object> dataTokenMap = (Map<String, Object>) result.get("data_token");
String contentUrl = (String) dataTokenMap.get("url");
In this case it seems that the package file needs to get downloaded differently.
HttpGet contentRequest = new HttpGet(contentUrl);
try (InputStream inputStream = iCloudService.getHttpClient().execute(contentRequest).getEntity().getContent())