Clean code
This commit is contained in:
parent
e56221d6d2
commit
f2e6a98b24
|
|
@ -45,7 +45,6 @@ public class Drive {
|
|||
return TextUtils.isEmpty(sboxDriveId) ? "" : sboxDriveId;
|
||||
}
|
||||
|
||||
|
||||
public Drive clean() {
|
||||
this.driveId = "";
|
||||
this.resourceDriveId = "";
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ public class Local extends Spider {
|
|||
File file = new File(path);
|
||||
if (file.getParentFile() == null) return Collections.emptyList();
|
||||
List<Sub> subs = new ArrayList<>();
|
||||
for (File f : Objects.requireNonNull(file.getParentFile().listFiles())) {
|
||||
for (File f : file.getParentFile().listFiles()) {
|
||||
String ext = Utils.getExt(f.getName());
|
||||
if (Utils.isSub(ext)) subs.add(Sub.create().name(Utils.removeExt(f.getName())).ext(ext).url("file://" + f.getAbsolutePath()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public class Proxy extends Spider {
|
|||
private static int port = -1;
|
||||
|
||||
public static Object[] proxy(Map<String, String> params) throws Exception {
|
||||
switch (Objects.requireNonNull(params.get("do"))) {
|
||||
switch (params.get("do")) {
|
||||
case "ck":
|
||||
return new Object[]{200, "text/plain; charset=utf-8", new ByteArrayInputStream("ok".getBytes("UTF-8"))};
|
||||
case "ali":
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public class Push extends Ali {
|
|||
private void setFileSub(String url, List<Sub> subs) {
|
||||
File file = new File(url.replace("file://", ""));
|
||||
if (file.getParentFile() == null) return;
|
||||
for (File f : Objects.requireNonNull(file.getParentFile().listFiles())) {
|
||||
for (File f : file.getParentFile().listFiles()) {
|
||||
String ext = Utils.getExt(f.getName());
|
||||
if (Utils.isSub(ext)) subs.add(Sub.create().name(Utils.removeExt(f.getName())).ext(ext).url("file://" + f.getAbsolutePath()));
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
8cfcd8600726cbd0dac219ec7d7e1a8b
|
||||
dc65fa8fabc0fba297b0dd6000af50be
|
||||
|
|
|
|||
Loading…
Reference in New Issue