mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-18 15:07:30 +01:00
Change the download event. Fix some bugs in download manager. Other minor changes.
This commit is contained in:
@@ -115,10 +115,8 @@ public final class DiskUtils {
|
||||
}
|
||||
|
||||
public static File saveBufferedSourceToDirectory(BufferedSource bufferedSource, File directory, String name) throws IOException {
|
||||
if (!directory.exists()) {
|
||||
if (!directory.mkdirs()) {
|
||||
throw new IOException("Failed Creating Directory");
|
||||
}
|
||||
if (!directory.exists() && !directory.mkdirs()) {
|
||||
throw new IOException("Failed Creating Directory");
|
||||
}
|
||||
|
||||
File writeFile = new File(directory, name);
|
||||
@@ -155,5 +153,12 @@ public final class DiskUtils {
|
||||
|
||||
inputFile.delete();
|
||||
}
|
||||
|
||||
public static synchronized void createDirectory(File directory) throws IOException {
|
||||
if (!directory.exists() && !directory.mkdirs()) {
|
||||
throw new IOException("Failed creating directory");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user