영상관리 파일 업로드 수정
This commit is contained in:
@@ -256,8 +256,7 @@ public class FIleChecker {
|
||||
return hasDriver;
|
||||
}
|
||||
|
||||
public static boolean mkDir(String dirPath)
|
||||
{
|
||||
public static boolean mkDir(String dirPath) {
|
||||
Path uploadTargetPath = Paths.get(dirPath);
|
||||
try {
|
||||
Files.createDirectories(uploadTargetPath);
|
||||
@@ -268,9 +267,6 @@ public class FIleChecker {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static List<Folder> getFolderAll(String dirPath, String sortType, int maxDepth) {
|
||||
|
||||
Path startPath = Paths.get(dirPath);
|
||||
@@ -454,12 +450,9 @@ public class FIleChecker {
|
||||
}
|
||||
|
||||
public static List<Basic> getFilesFromAllDepth(
|
||||
String dir,
|
||||
String targetFileNm,
|
||||
String extension) {
|
||||
String dir, String targetFileNm, String extension) {
|
||||
|
||||
return FIleChecker.getFilesFromAllDepth(
|
||||
dir, targetFileNm, extension, 100, "name", 0, 100);
|
||||
return FIleChecker.getFilesFromAllDepth(dir, targetFileNm, extension, 100, "name", 0, 100);
|
||||
}
|
||||
|
||||
public static Long getFileTotSize(List<FIleChecker.Basic> files) {
|
||||
@@ -472,21 +465,16 @@ public class FIleChecker {
|
||||
return fileTotSize;
|
||||
}
|
||||
|
||||
public static boolean checkExtensions(String fileName, String ext)
|
||||
{
|
||||
if( fileName == null )return false;
|
||||
public static boolean checkExtensions(String fileName, String ext) {
|
||||
if (fileName == null) return false;
|
||||
|
||||
if (!fileName
|
||||
.substring(fileName.lastIndexOf('.') + 1)
|
||||
.toLowerCase()
|
||||
.equals(ext)) {
|
||||
if (!fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase().equals(ext)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static Set<String> createExtensionSet(String extensionString) {
|
||||
if (extensionString == null || extensionString.isBlank()) {
|
||||
return Set.of();
|
||||
|
||||
@@ -19,7 +19,8 @@ public class UserUtil {
|
||||
auth -> {
|
||||
CustomUserDetails user = (CustomUserDetails) auth.getPrincipal();
|
||||
MemberEntity m = user.getMember();
|
||||
return new MembersDto.Member(m.getId(), m.getName(), m.getEmployeeNo());
|
||||
return new MembersDto.Member(
|
||||
m.getId(), m.getName(), m.getEmployeeNo(), m.getUserRole());
|
||||
})
|
||||
.orElse(null);
|
||||
}
|
||||
@@ -38,4 +39,9 @@ public class UserUtil {
|
||||
MembersDto.Member user = getCurrentUser();
|
||||
return user != null ? user.getEmployeeNo() : null;
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
MembersDto.Member user = getCurrentUser();
|
||||
return user != null ? user.getRole() : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user