square / okio

A modern I/O library for Android, Java, and Kotlin Multiplatform.
https://square.github.io/okio/
Apache License 2.0
8.76k stars 1.18k forks source link

API for unwrapping FileSystem #1465

Closed yschimke closed 5 months ago

yschimke commented 5 months ago

Maybe unblocked by https://github.com/square/okio/issues/1464

But given a FileSystem, I'd like to be able to unwrap it to tell it's real type. Is it FileSystem.SYSTEM under the hood? or a zip file? or resources? or S3?

swankjesse commented 5 months ago

I don’t want to do this because I think it’ll lead to fragile code in practice.

But I do think we should design a mechanism to add extensions to the file system API so it doesn’t have to be comprehensive always. Perhaps something like OkHttps request tags.

swankjesse commented 5 months ago

https://github.com/square/okio/issues/1466