ZipFile::Builder should be able to take URL's

Hi,

those lines in juce::ZipFile (572-575) refere to a juce::File:

            stream = file.createInputStream();

            if (stream == nullptr)
                return false;

on ios writing fails if the file came from an url which originally had write access, because juce::URL::getLocalFile looses its bookmark information. addEntry should be able to take also URLs, so that we can create zip files on ios without workaround of copying to a place where there is no need for URLs.

Thanks!

Best, equinox

Oh I wasn’t aware of addEntry. So what you have to do is:

if (auto stream = url.createInputStream (options))
   zipBuilder.addEntry (stream.release(), ...)

ZipBuilder will take care of Ownership so release is fine here.