private void downloadFile(ManifestFile f, MiniHttpClient hc) throws MalformedURLException, IOException, NoSuchAlgorithmException{
        progress = 0;
        alternative = false;
        java.io.File targetDir = new java.io.File(patcher.getFileDir(f));
        java.io.File target = new java.io.File(targetDir.getPath() + "/" + f.name);
        targetDir.mkdirs();
        
        if(!target.createNewFile() && (patcher.force || patcher.forceSingleFiles)){
            alternative = true;
            if(checkHash(new BufferedInputStream(new FileInputStream(target)), patcher, f)){
                return;
            }
        }
        progress = 0;
        
        String url = "/releases/"+patcher.branch+"/"+patcher.type+"/"
            + patcher.project + "/releases/" + f.release + "/files/" + 
            f.path.replaceAll(" ", "%20") + f.name.replaceAll(" ", "%20") + (f.fileType > 0 ? ".compressed" : "");

        MiniHttpClient.HttpResult hte = hc.get(url);
        InputStream fileStream = hte.in;
        long total = 0;
        
        try(InputStream in = (
                f.fileType > 0 ? 
                    new InflaterInputStream(fileStream) :
                    fileStream)){
            
            try(OutputStream fo = new BufferedOutputStream(new FileOutputStream(target))){
                int read;
                byte[] buffer = new byte[4096];
                while((read = in.read(buffer)) != -1){
                    fo.write(buffer, 0, read);
                    speedStat(read);
                    total += read;
                    progress = (float) total / f.sizeCompressed;
                    if(patcher.done) return;
                }
            }
        }
        progress = 1;
    }