Вы должны забыть Android-сборку в диспетчере загрузок и создать свой собственный менеджер. Тогда вы можете скачать по пути: getCacheDir().getAbsolutePath();
Вот пример кода для самостоятельной загрузки файла без встроенного менеджера
public String downloadFile(String fileURL, String fileName) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
Log.d(TAG, "Downloading...");
try {
int lastDotPosition = fileName.lastIndexOf('/');
if( lastDotPosition > 0 ) {
String folder = fileName.substring(0, lastDotPosition);
File fDir = new File(folder);
fDir.mkdirs();
}
//Log.i(TAG, "URL: " + fileURL);
//Log.i(TAG, "File: " + fileName);
URL u = new URL(fileURL);
HttpURLConnection c = (HttpURLConnection) u.openConnection();
c.setRequestMethod("GET");
c.setReadTimeout(30000);
c.connect();
double fileSize = (double) c.getContentLength();
int counter = 0;
while ( (fileSize == -1) && (counter <=30)){
c.disconnect();
u = new URL(fileURL);
c = (HttpURLConnection) u.openConnection();
c.setRequestMethod("GET");
c.setReadTimeout(30000);
c.connect();
fileSize = (double) c.getContentLength();
counter++;
}
File fOutput = new File(fileName);
if (fOutput.exists())
fOutput.delete();
BufferedOutputStream f = new BufferedOutputStream(new FileOutputStream(fOutput));
InputStream in = c.getInputStream();
byte[] buffer = new byte[8192];
int len1 = 0;
int downloadedData = 0;
while ((len1 = in.read(buffer)) > 0) {
downloadedData += len1;
f.write(buffer, 0, len1);
}
Log.d(TAG, "Finished");
f.close();
return fileName;
}
catch (Exception e) {
e.printStackTrace();
Log.e(TAG, e.toString());
return null;
}
}