Class DownloadableResource


  • public class DownloadableResource
    extends Object
    Model that is used to add resources to a download session when implementing Downloadable.

    Please note that you usually do not interact with the class. It is used by other plugins to expose a downloader resource and it is port of the core SDK to avoid an explicit dependency to the Downloader Plugin.

    Since:
    4.0.0
    • Constructor Detail

      • DownloadableResource

        public DownloadableResource()
    • Method Detail

      • createTarget

        public static File createTarget​(@NonNull
                                        Uri resource,
                                        @NonNull
                                        File basePath,
                                        @Nullable
                                        String remoteManifestUrl,
                                        boolean relativeToManifest)
        Create a path to a local file given the remote resource, the manifest URL and the base path. If specified, this will create a target folder relative to the manifest if that is possible, i.e. the manifest comes from the same host and has the same base path structure.
        Parameters:
        resource - The URL to the resource to download
        basePath - The target folder base path
        remoteManifestUrl - The URL to the manifest
        relativeToManifest - If true, this will try to resolve a path relative to the manifest
        Returns:
        The local target path for this resource