Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZipFileSystem should expose more metadata #1425

Open
swankjesse opened this issue Feb 6, 2024 · 1 comment
Open

ZipFileSystem should expose more metadata #1425

swankjesse opened this issue Feb 6, 2024 · 1 comment

Comments

@swankjesse
Copy link
Collaborator

We should expose stuff from ZipEntry in the ZipFileSystem’s FileMetadata, using the extras field.

For example, we could include any of the following:

  /** The comment on this entry. Empty if there is no comment. */
  val comment: String = ""

  /** The CRC32 of the uncompressed data, or -1 if not set. */
  val crc: Long = -1L

  /** The compressed size in bytes, or -1 if unknown. */
  val compressedSize: Long = -1L

  /** Either [COMPRESSION_METHOD_DEFLATED] or [COMPRESSION_METHOD_STORED]. */
  val compressionMethod: Int = -1
@JakeWharton
Copy link
Collaborator

I selfishly would like to see the amount of bytes the file requires in the actual zip format. That is, to say, summing the format size of each file should produce a total that is equal to the size of the whole .zip (less the central directory header and trailer).

Here's what I'm doing now: https://github.com/JakeWharton/diffuse/blob/trunk/io/src/main/kotlin/com/jakewharton/diffuse/io/Zip.kt#L71-L107

I would be happy if this was a derived value, just more plainly derived. Such as original size, stored size, and metadata size (where what I want is stored + metadata).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants