yoursyun

유일한 파일명으로 변경 처리 본문

program/java

유일한 파일명으로 변경 처리

yoursyun 2013. 11. 26. 17:37

유일한 파일명으로 변경 처리


while (uploadFile.exists()) {

nmFile = nmFile.substring(0, nmFile.indexOf(".")) + "(" + i + ")" + nmFile.substring(nmFile.indexOf("."), nmFile.length());

uploadFile.renameTo(new File(uploadRepository + nmFile));

i++;

}

반응형