Fetch
Fetch copied to clipboard
Issues with Storage Access Framework
I am trying to integrate fetch to work with the Storage Access Framework. Decided to use https://github.com/anggrayudi/SimpleStorage which simplifies the use. Using it however an error of UNKNOWN_IO_ERROR keeps getting thrown. How can we use Fetch to support SAF, am I missing something?
Fetch uses java.io.File, I will assume that it does not support scoped storage yet. Or does Fetch to have scoped storage support for API 29+?
@DavidKmn thanks for using Fetch. By default Fetch uses the java.io.File and simple SAF via the DefaultStorageResolver.
You can provide Fetch with your own StorageResolver to handle creating, renaming, deleting, and storing data. Eg:
final FetchConfiguration fetchConfiguration = new FetchConfiguration.Builder(this)
.enableRetryOnNetworkGain(true)
.setDownloadConcurrentLimit(3)
.setStorageResolver(new MyStorageResolver(context))
.build()
Fetch.Impl.setDefaultInstanceConfiguration(fetchConfiguration);
Take a look at the StorageResolver
Java docs for more information.
Thanks for the help @tonyofrancis. Love the library 👍