Closed nic0lette closed 3 years ago
Using java.net.URI
is probably a Bad Idea. The rest of this is a Good Idea. Instead of java.net.URI
, methods should take DocumentPath
, since it works on both Android and host tests, but doesn't end up converting a Path
to a java.net.URI
just to convert it to an android.net.Uri
.
This is mostly done in dev
now.
Instead of various methods which are identical, or almost identical, to the
DocumentsContract
, makePlatformContract
define an interface which matches the Android version (with the exception of usingjava.net.URI
rather thanandroid.net.Uri
for testing on non-Android devices)Interface or abstract class? Both could have default implementations that would allow defining helper methods.
Perhaps best would be an
interface
forDocumentsContract
and then a class that uses that interface for defining lower level helper methods that can be used by the filesystem classes without worrying aboutDocumentsContract
at all.