Initial commit

This commit is contained in:
2025-05-13 19:24:51 +02:00
commit a950f49678
10604 changed files with 932663 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
package com.liulishuo.filedownloader.exception;
/* loaded from: classes.dex */
public class FileDownloadGiveUpRetryException extends RuntimeException {
public FileDownloadGiveUpRetryException(String str) {
super(str);
}
}

View File

@@ -0,0 +1,42 @@
package com.liulishuo.filedownloader.exception;
import com.liulishuo.filedownloader.util.FileDownloadUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/* loaded from: classes.dex */
public class FileDownloadHttpException extends IOException {
private final int mCode;
private final Map<String, List<String>> mRequestHeaderMap;
private final Map<String, List<String>> mResponseHeaderMap;
public FileDownloadHttpException(int i, Map<String, List<String>> map, Map<String, List<String>> map2) {
super(FileDownloadUtils.a("response code error: %d, \n request headers: %s \n response headers: %s", Integer.valueOf(i), map, map2));
this.mCode = i;
this.mRequestHeaderMap = cloneSerializableMap(map);
this.mResponseHeaderMap = cloneSerializableMap(map);
}
private static Map<String, List<String>> cloneSerializableMap(Map<String, List<String>> map) {
HashMap hashMap = new HashMap();
for (Map.Entry<String, List<String>> entry : map.entrySet()) {
hashMap.put(entry.getKey(), new ArrayList(entry.getValue()));
}
return hashMap;
}
public int getCode() {
return this.mCode;
}
public Map<String, List<String>> getRequestHeader() {
return this.mRequestHeaderMap;
}
public Map<String, List<String>> getResponseHeader() {
return this.mResponseHeaderMap;
}
}

View File

@@ -0,0 +1,8 @@
package com.liulishuo.filedownloader.exception;
/* loaded from: classes.dex */
public class FileDownloadNetworkPolicyException extends FileDownloadGiveUpRetryException {
public FileDownloadNetworkPolicyException() {
super("Only allows downloading this task on the wifi network type");
}
}

View File

@@ -0,0 +1,41 @@
package com.liulishuo.filedownloader.exception;
import android.annotation.TargetApi;
import com.liulishuo.filedownloader.util.FileDownloadUtils;
import java.io.IOException;
/* loaded from: classes.dex */
public class FileDownloadOutOfSpaceException extends IOException {
private long breakpointBytes;
private long freeSpaceBytes;
private long requiredSpaceBytes;
@TargetApi(9)
public FileDownloadOutOfSpaceException(long j, long j2, long j3, Throwable th) {
super(FileDownloadUtils.a("The file is too large to store, breakpoint in bytes: %d, required space in bytes: %d, but free space in bytes: %d", Long.valueOf(j3), Long.valueOf(j2), Long.valueOf(j)), th);
init(j, j2, j3);
}
private void init(long j, long j2, long j3) {
this.freeSpaceBytes = j;
this.requiredSpaceBytes = j2;
this.breakpointBytes = j3;
}
public long getBreakpointBytes() {
return this.breakpointBytes;
}
public long getFreeSpaceBytes() {
return this.freeSpaceBytes;
}
public long getRequiredSpaceBytes() {
return this.requiredSpaceBytes;
}
public FileDownloadOutOfSpaceException(long j, long j2, long j3) {
super(FileDownloadUtils.a("The file is too large to store, breakpoint in bytes: %d, required space in bytes: %d, but free space in bytes: %d", Long.valueOf(j3), Long.valueOf(j2), Long.valueOf(j)));
init(j, j2, j3);
}
}

View File

@@ -0,0 +1,8 @@
package com.liulishuo.filedownloader.exception;
/* loaded from: classes.dex */
public class FileDownloadSecurityException extends Exception {
public FileDownloadSecurityException(String str) {
super(str);
}
}

View File

@@ -0,0 +1,29 @@
package com.liulishuo.filedownloader.exception;
import com.liulishuo.filedownloader.util.FileDownloadUtils;
/* loaded from: classes.dex */
public class PathConflictException extends IllegalAccessException {
private final int mAnotherSamePathTaskId;
private final String mDownloadingConflictPath;
private final String mTargetFilePath;
public PathConflictException(int i, String str, String str2) {
super(FileDownloadUtils.a("There is an another running task(%d) with the same downloading path(%s), because of they are with the same target-file-path(%s), so if the current task is started, the path of the file is sure to be written by multiple tasks, it is wrong, then you receive this exception to avoid such conflict.", Integer.valueOf(i), str, str2));
this.mAnotherSamePathTaskId = i;
this.mDownloadingConflictPath = str;
this.mTargetFilePath = str2;
}
public int getAnotherSamePathTaskId() {
return this.mAnotherSamePathTaskId;
}
public String getDownloadingConflictPath() {
return this.mDownloadingConflictPath;
}
public String getTargetFilePath() {
return this.mTargetFilePath;
}
}