Several issues with MFileZip have come to light since it has been incorporated in the TDS as part of the zarr code. This PR fixes these and adds some unit tests.
Fix getLastModified and getLength for the root zip file to not return 0
Fix writeToStream to work the same as it would for a MFileOS
Allow the zip extension to be case insensitive
Add isZipFile to MFile interface. In the TDS, the fileServer should allow downloading zips but disallow downloading directories. MFileZips can be considered directories. So we need a way to distinguish between directories and zip files. This is what I came up with but we could also consider changing isDirectory or doing something else. See https://github.com/Unidata/tds/pull/501 for proposed TDS change.
Description of Changes
Several issues with
MFileZip
have come to light since it has been incorporated in the TDS as part of the zarr code. This PR fixes these and adds some unit tests.getLastModified
andgetLength
for the root zip file to not return 0writeToStream
to work the same as it would for aMFileOS
isZipFile
toMFile
interface. In the TDS, the fileServer should allow downloading zips but disallow downloading directories.MFileZip
s can be considered directories. So we need a way to distinguish between directories and zip files. This is what I came up with but we could also consider changingisDirectory
or doing something else. See https://github.com/Unidata/tds/pull/501 for proposed TDS change.