Support usb path
This commit is contained in:
parent
98256dad90
commit
86fc2cd5fd
|
|
@ -33,8 +33,14 @@ public class Local extends Spider {
|
||||||
@Override
|
@Override
|
||||||
public String homeContent(boolean filter) throws Exception {
|
public String homeContent(boolean filter) throws Exception {
|
||||||
List<Class> classes = new ArrayList<>();
|
List<Class> classes = new ArrayList<>();
|
||||||
String root = Environment.getExternalStorageDirectory().getAbsolutePath();
|
classes.add(new Class(Environment.getExternalStorageDirectory().getAbsolutePath(), "本地文件", "1"));
|
||||||
classes.add(new Class(root, "本地文件", "1"));
|
File[] files = new File("/storage").listFiles();
|
||||||
|
if (files == null) return Result.string(classes, new ArrayList<>());
|
||||||
|
List<String> exclude = Arrays.asList("emulated", "sdcard", "self");
|
||||||
|
for (File file : files) {
|
||||||
|
if (exclude.contains(file.getName())) continue;
|
||||||
|
classes.add(new Class(file.getAbsolutePath(), file.getName(), "1"));
|
||||||
|
}
|
||||||
return Result.string(classes, new ArrayList<>());
|
return Result.string(classes, new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
ca59a045079b3b0d57696149fa73864f
|
e276d142b10b9f2c2971664d0b9dc9a3
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue