public boolean download(File targetFile, String url, MavenArtefact artefact, String extension, String preresolvedVersion, boolean metafile) {
        try {

            buildParentDir(targetFile);

            //BUILD HTTP URL
            StringBuilder urlBuilder = new StringBuilder();
            urlBuilder.append(url);
            if(!url.endsWith(urlSep)){
                urlBuilder.append(urlSep);
            }
            urlBuilder.append(artefact.getGroup().replace(".", "/"));
            urlBuilder.append(urlSep);
            urlBuilder.append(artefact.getName());
            urlBuilder.append(urlSep);
            urlBuilder.append(artefact.getVersion());
            urlBuilder.append(urlSep);
            if (metafile) {
                urlBuilder.append(MavenVersionResolver.metaFile);
            } else {
                urlBuilder.append(artefact.getName());
                urlBuilder.append("-");
                if (preresolvedVersion != null) {
                    urlBuilder.append(preresolvedVersion);
                } else {
                    urlBuilder.append(artefact.getVersion());
                }
                urlBuilder.append(".");
                urlBuilder.append(extension);
            }

            //DOWNLOAD FILE
            URL artefactURL = new URL(urlBuilder.toString());

            URLConnection con = artefactURL.openConnection();
            con.setRequestProperty("User-Agent", "Kevoree");
            String location = con.getHeaderField("Location");
            if(location != null){
                try {
                    con.getInputStream().close();
                } catch (Exception e){
                }
                con = new URL(location).openConnection();
                con.setRequestProperty("User-Agent", "Kevoree");
            }

            InputStream in = con.getInputStream();

            FileOutputStream fos = new FileOutputStream(targetFile);
            byte data[] = new byte[1024];
            int count;
            while ((count = in.read(data, 0, 1024)) != -1) {
                fos.write(data, 0, count);
            }
            in.close();
            fos.close();

            /*
            ReadableByteChannel rbc = Channels.newChannel(artefactURL.openStream());
            FileOutputStream fos = new FileOutputStream(targetFile);
            fos.getChannel().transferFrom(rbc, 0, 1 << 24);
            fos.close();
            */




            return true;
        } catch (Throwable t) {
            //TODO CLEANUP FILE IF CORRUPTED
            return false;
        }
    }