You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
755 B
33 lines
755 B
package com.platform.test;
|
|
|
|
import java.io.File;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
public class linuxTest {
|
|
|
|
public static void main(String[] args) {
|
|
List<String> paths = new ArrayList<String>();
|
|
List<String> rs = getallfile(paths, "/DefaultDescription_last");
|
|
for (String string : rs) {
|
|
System.out.println(string);
|
|
}
|
|
}
|
|
|
|
private static List<String> getallfile(List<String> ps, String path){
|
|
File f = new File(path);
|
|
ps.add(f.getAbsolutePath());
|
|
System.out.println(f.exists());
|
|
if (f.exists()) {
|
|
String[] subpaths = f.list();
|
|
if (null != subpaths) {
|
|
for (String tmppath : subpaths) {
|
|
getallfile(ps, f.getAbsolutePath()+"/"+tmppath);
|
|
}
|
|
}
|
|
}
|
|
return ps;
|
|
}
|
|
|
|
}
|