
실전에서도 유용하게 쓰는 자바의 파일 사용법 모음집입니다! 파일 쓰기 // file: 저장할 경로 // content: 저장할 컨텐츠 public boolean write(File file, String content) { try { if (!file.exists()) { file.createNewFile(); } FileOutputStream fos = new FileOutputStream(file); fos.write(content.getBytes(StandardCharsets.UTF_8)); fos.flush(); fos.close(); } catch (Exception e) { log.error(ExceptionUtils.getStackTrace(e)); return false; } finally..
Server
2021. 8. 30. 22:05
공지사항