Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Add support for file paths #87

Merged
merged 14 commits into from Feb 7, 2022
Merged

Add support for file paths #87

merged 14 commits into from Feb 7, 2022

Conversation

yrezgui
Copy link
Collaborator

@yrezgui yrezgui commented Feb 3, 2022

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())

@yrezgui yrezgui marked this pull request as ready for review February 4, 2022 17:24
@yrezgui yrezgui merged commit 5acfe8a into main Feb 7, 2022
@yrezgui yrezgui deleted the internal-filesystem branch February 7, 2022 09:40
yrezgui added a commit that referenced this pull request Mar 18, 2022
* doc: correct usage of `ActivityResultContract` `launch` method (#86)

* Rename MediaStore tests

* Upgrade to Android Studio BumbleBee & AGP 7.1

* Update run configuration

* Apply spotless

* Fix closing resources when file copy is done

* Add support for file paths (#87)

* Deprecate SharedFileSystem in favor of AndroidFileSystem

Add support for Photo Picker metadata fetching

* Add appendingSink implementation

* Add support for file paths (makes interactions with Internal Storage possible)

* Implement delete for physical files

Add more internal storage tests

* Enable (temporarily) tests on GitHub Actions

* Apply spotless

* Update sample to use AndroidFileSystem

Disable tests (they're getting cancelled on GitHub Actions for no reason...)

* Improve greatly platform testing coverage

Deprecate Uri.toPath in favor of Uri.toOkioPath
Add scanFile method

* Upgrade version number

Update storage guide

* Fix type selection in photo picker

* Fix metadata fetchinf for photo picker URIs

* Updating storage guide

* Fix deprecation issue for the old createMediaStoreUri method

Update sample to use new createMediaStoreUri method

* Upgrade AGP to 7.1.1

* Fix a few mistakes in permission.md (#89)

* Update Android 13 notice for the photo picker

* Add refreshVersions Gradle plugin

* Migrate dependencies management to refreshVersions plugin

* Remove version catalog feature preview

* Upgrade dependencies

Remove unused dependencies
Fix code imports

* Get kotlinCompilerExtensionVersion from versions.properties

* Remove completely versions catalog

* Revert code change

Co-authored-by: tobianoapps <14228120+sebastinto@users.noreply.github.com>
Co-authored-by: Andreas <andreas.everos@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant