|
|
|
|
@ -1,8 +1,6 @@
|
|
|
|
|
package cokr.xit.base.file.service.bean;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
@ -130,15 +128,10 @@ public class FileBean extends AbstractBean {
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
protected void mkdirs(List<FileInfo> files) throws Exception {
|
|
|
|
|
Set<String> dirs = files.stream()
|
|
|
|
|
files.stream()
|
|
|
|
|
.map(file -> FileInfo.dir(file.getPath()))
|
|
|
|
|
.collect(Collectors.toSet());
|
|
|
|
|
|
|
|
|
|
for (String path: dirs) {
|
|
|
|
|
File dir = new File(path);
|
|
|
|
|
if (!dir.exists())
|
|
|
|
|
dir.mkdirs();
|
|
|
|
|
}
|
|
|
|
|
.collect(Collectors.toSet())
|
|
|
|
|
.forEach(FileBean::ensureDir);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**주어진 파일 정보 아이디의 순서대로 정렬 순서를 변경한다.
|
|
|
|
|
|