mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2024-11-24 03:52:36 +01:00
update DownloadManager.java
* check if the directory pending_downloads was created
This commit is contained in:
parent
60d4c8a55d
commit
da052df106
@ -75,10 +75,6 @@ public class DownloadManager {
|
|||||||
mMissionsFinished = loadFinishedMissions();
|
mMissionsFinished = loadFinishedMissions();
|
||||||
mPendingMissionsDir = getPendingDir(context);
|
mPendingMissionsDir = getPendingDir(context);
|
||||||
|
|
||||||
if (!Utility.mkdir(mPendingMissionsDir, false)) {
|
|
||||||
throw new RuntimeException("failed to create " + DOWNLOADS_METADATA_FOLDER + " directory");
|
|
||||||
}
|
|
||||||
|
|
||||||
loadPendingMissions(context);
|
loadPendingMissions(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,6 +92,11 @@ public class DownloadManager {
|
|||||||
if (dir == null) return false;
|
if (dir == null) return false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (!Utility.mkdir(dir, false)) {
|
||||||
|
Log.e(TAG, "testDir() cannot create the directory in path: " + dir.getAbsolutePath());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
File tmp = new File(dir, ".tmp");
|
File tmp = new File(dir, ".tmp");
|
||||||
if (!tmp.createNewFile()) return false;
|
if (!tmp.createNewFile()) return false;
|
||||||
return tmp.delete();// if the file was created, SHOULD BE deleted too
|
return tmp.delete();// if the file was created, SHOULD BE deleted too
|
||||||
|
Loading…
Reference in New Issue
Block a user