Skip to main content

2.3.0-rc1

  • CL-15257 File access using Uris instead of absolute file paths.

Major changes:

  • FileItem: the attr localPath contains a valid absolute path if only offlineStatus == AVAILABLE. In other cases a path might be invalid or inaccessible for the app.

  • DownloaderEvent: breaking change: the attr destPath was removed.

  • OperationDownload: breaking change: the attr destination was removed.

  • FileDownloader:

    • Breaking change: the static method checkSelfPermissions() was removed because the way how permissions should be checked depends on how a file is enqueued for downloading.

    • The new method enqueueFile() was added that accepts Uri as a target directory specification. If your app has write access to local storage you can call old method (which accepts absolute paths), but if scoped storage restrictions (as of Android 10+) are applied to your app, you should use SAF-provided Uris.

    • Downloading of a file to a directory, specified by an absolute path is possible if the app has the android.permission.WRITE_EXTERNAL_STORAGE permission and has opted-out from scoped storage restrictions as of Android 10+. In other cases the app should use SAF-provided Uri. Otherwise downloading will fail.

  • FileUploader:

    • The new methods enqueueFile() were added which accept Uri as a source file specification. If your app has read access to local storage you can call old methods (which accepts absolute file paths), but if scoped storage restrictions (as of Android 10+) are applied to your app, you should use SAF-provided Uris. Otherwise uploading will fail.
    • When the app passes source file for uploader as Uri, the enqueueFile() method takes 'persistable uri permission' for given Uri and releases it when a file either: successfully uploaded, cancelled or failed to read.