URL url = new URL(theUrl);
ReadableByteChannel inChannel = Channels.newChannel(url.openStream());
FileOutputStream out = new FileOutputStream(lib.getFile(libDir));
out.getChannel().transferFrom(inChannel, 0, Long.MAX_VALUE);
out.close();
LibraryStatus status = lib.testIntegrity(libDir);
if (status == LibraryStatus.PASSED) {
return DownloadStatus.SUCCESS;
} else {
return DownloadStatus.DOWNLOAD_FAILED;
}