With this PR, Path can be Uri but also java.io.File paths, allowing interactions with internal storage.
One very cool feature enabled with these changes would be to copy a MediaStore image to internal storage simply:
val fileSystem = AndroidFileSystem(context)
// Image taken from MediaStore
val imageUri = Uri.parse("content://media/external/images/media/47")
// Target file inside the internal storage
val target = File(appContext.filesDir, "cool-image.jpg")
// Copying a file is now done in one line!
fileSystem.copy(imageUri.toOkioPath(), target.toOkioPath())
With this PR,
Path
can beUri
but alsojava.io.File
paths, allowing interactions with internal storage.One very cool feature enabled with these changes would be to copy a MediaStore image to internal storage simply: