// 获取临时目录下的所有的图片
File imagesFile = new File(basePath);
String[] imagesFullFileName = imagesFile.list(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.endsWith(".png") || name.endsWith(".gif")
|| name.endsWith(".jpg") || name.endsWith(".bmp");
}
});
获取一个目录下的名称符合一定要求的全部文件+目录,可以防止没有必要的文件被传入系统。
最新推荐文章于 2019-11-11 14:14:10 发布