반응형 Java파일복사1 【Java-파일】파일복사 1. 설명 이 포스트에서 다루는 예제는 파일을 복사하는 코드입니다. 2. 소스코드 - 메서드 public boolean copy(String originPath, String destPath, boolean rename) throws IOException { File originFile = new File(originPath); if ( !originFile.exists() ) { return false; // 복사할 파일 } File destFile = new File(destPath); if ( destFile.exists() && !rename ) { return false; // 결과 파일이 이미 존재하며, 덮어쓰기 플래그가 false라면 } InputStream is = null; OutputS.. 2021. 9. 12. 이전 1 다음 반응형