AccessController.doPrivileged(new PrivilegedExceptionAction() {
public Object run() throws IOException {
File file = File.createTempFile("jar_cache", "");
FileOutputStream out = new FileOutputStream(file);
try {
RedirectibleInput r =
new RedirectingInputStream(in, false, false);
int len = r.redirectAll(out);
out.flush();
if (len == 0) {
// e.g. HttpURLConnection: "NOT_MODIFIED"
return null;
}