Class DownloadableResource

java.lang.Object
com.castlabs.android.downloader.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
  • Field Details

  • Constructor Details

    • DownloadableResource

      public DownloadableResource()
  • Method Details

    • 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