
private final 변수가 다른 곳에서 먼저 생성자로 사용하고 있을 때?
개발/JAVA
2022. 10. 31. 16:06
다른 곳에서 private final이 생성자로 사용 중이다. 이럴 때, 문제 : 해결 : 로 생성자를 의존성 주입 시켜 만들어준다.
Files 관련 StandardCopyOption 정의
개발/JAVA
2022. 10. 20. 14:25
# StandardCopyOption.REPLACE_EXISTING Files.copy(file.getInputStream(), targetLocation, StandardCopyOption.REPLACE_EXISTING); StandardCopyOption.REPLACE_EXISTING 똑같은 파일(이름 같은것)이 있을때 덮어쓴다. # Files.createDirectory Files.createDirectories(this.fileLocation); Files.createDirectory(path); path에 해당하는 디렉토리를 만듬. # Files.exists Path path = Paths.get("/tmp/test.txt"); boolean exists = Files.exists(path, L..