|
@ -34,7 +34,7 @@ public class MobileFile extends Plugin{
|
34
|
34
|
|
35
|
35
|
public void cleanResource(String relativePath, boolean isSdcard) {
|
36
|
36
|
String absolutePath = util.getDirection(relativePath, isSdcard);
|
37
|
|
FileUtil.deleteDir(absolutePath);
|
|
37
|
cleanDir(new File(absolutePath));
|
38
|
38
|
|
39
|
39
|
String[] fileList = new File(absolutePath).list();
|
40
|
40
|
if (fileList.length == 0) {
|
|
@ -44,6 +44,22 @@ public class MobileFile extends Plugin{
|
44
|
44
|
}
|
45
|
45
|
}
|
46
|
46
|
|
|
47
|
/**
|
|
48
|
* 清空文件夹
|
|
49
|
*/
|
|
50
|
private boolean cleanDir(File dir){
|
|
51
|
if(dir.isDirectory()){
|
|
52
|
String[] children = dir.list();
|
|
53
|
for(int i = 0;i < children.length; i++){
|
|
54
|
boolean success = FileUtil.deleteDir(new File(dir, children[i]));
|
|
55
|
if(!success){
|
|
56
|
return false;
|
|
57
|
}
|
|
58
|
}
|
|
59
|
}
|
|
60
|
return true;
|
|
61
|
}
|
|
62
|
|
47
|
63
|
public void getAllFile(JSONArray param) throws Exception{
|
48
|
64
|
String fileName = param.getString(0); //相对路径参数
|
49
|
65
|
String type = param.getString(1);
|