icloud4j icon indicating copy to clipboard operation
icloud4j copied to clipboard

Handling packages from the DriveNode class≈

Open tibexl opened this issue 4 years ago • 0 comments

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())

tibexl avatar Aug 21 '20 16:08 tibexl