Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public File unpackClient(URL url, File targetDir, String clientname) throws IOException {
- if(!targetDir.exists()) {
- targetDir.mkdirs();
- }
- this.theme.setAuth("Скачивание обновления " + clientname);
- URLConnection urlconnection = url.openConnection();
- this.totalDownload = urlconnection.getContentLength() / 1024;
- this.onePercent = (double)(this.totalDownload / 100);
- BufferedInputStream in = new BufferedInputStream(url.openStream(), 1024);
- File zip = File.createTempFile("client", ".zip", targetDir);
- BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(zip));
- this.copyInputStream(in, out, false);
- out.close();
- return this.unpackArchive(zip, targetDir);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement