1 year ago

#376721

test-img

hinrich.

Java Download ZIP for update

Temporarily I want to provide updates for my program in a cloud (e.g. OneDrive). I tried some code variation. Some of them produce an empty file that cannot be opened. With some I get an empty ZIP. With all cloud services I do not get a direct link (like https://[...]/latest.zip).

            File file = new File (updatePath, "latest.zip");

            try{
                ReadableByteChannel rbc=Channels.newChannel(updateURL.openStream());
                FileOutputStream fileOut = new FileOutputStream(file);
                fileOut.getChannel().transferFrom(rbc, 0, 1 << 24);
                fileOut.flush();
                fileOut.close();
                rbc.close();
            }catch(Exception e){ e.printStackTrace(); }

How can I download the ZIP WITHOUT including an external API. And can I get a) the filename of the file to download and b) the state of the download?

java

download

cloud

onedrive

0 Answers

Your Answer

Accepted video resources