Skip to content

Commit

Permalink
Feat : #33 주석 삭제후 함수의 의도를 더 잘 나타내도록 함수명 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hyobim committed Jan 10, 2023
1 parent 9cbd153 commit 681620f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ public String uploadFile(MultipartFile multipartFile, String filePath) {
}


private String createRandomizedFileName(String fileName) {
return UUID.randomUUID().toString().concat(getFileExtension(fileName));
private String createRandomizedFileName(String fileName) {
return UUID.randomUUID().toString().concat(verifyFileExtension(fileName));
}

private String getFileExtension(String fileName) { // file 형식이 잘못된 경우를 확인하기 위해 만들어진 로직이며, 파일 타입과 상관없이 업로드할 수 있게 하기 위해 .의 존재 유무만 판단하였습니다.
private String verifyFileExtension(String fileName) {
try {
return fileName.substring(fileName.lastIndexOf("."));
} catch (StringIndexOutOfBoundsException e) {
Expand Down

0 comments on commit 681620f

Please sign in to comment.