파일을 복사할때 동일한 파일이 존재하는 경우 덮어쓰지 않도록 하려면 이름에 숫자를 붙여서 만들어야 하는 경우가 종종 발생함 fileName.txt, fileName(1).txt, fileName(2).txt ... 와 같이 (숫자)를 붙여서 새로운 파일명을 생성하여 처리 public static String getNewFileName(String toFilePath) { String dest = toFilePath; String dot = "."; if (StringUtils.isEmpty(toFilePath)) return dest; if(!Files.exists(Paths.get(dest))) return dest; try { File f = new File(toFilePath); String fil..