use of com.luck.picture.lib.weiui.library.entity.LocalMediaFolder in project weiui by kuaifan.
the class LocalMediaLoader method getImageFolder.
/**
* 创建相应文件夹
*
* @param path
* @param imageFolders
* @return
*/
private LocalMediaFolder getImageFolder(String path, List<LocalMediaFolder> imageFolders) {
File imageFile = new File(path);
File folderFile = imageFile.getParentFile();
for (LocalMediaFolder folder : imageFolders) {
// 同一个文件夹下,返回自己,否则创建新文件夹
if (folder.getName().equals(folderFile.getName())) {
return folder;
}
}
LocalMediaFolder newFolder = new LocalMediaFolder();
newFolder.setName(folderFile.getName());
newFolder.setPath(folderFile.getAbsolutePath());
newFolder.setFirstImagePath(path);
imageFolders.add(newFolder);
return newFolder;
}
Aggregations