일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- restapi
- 자바
- GIT
- Spring
- Intellij
- DATABASE
- jdk
- React
- 쿼리
- crud
- 컴포넌트
- sql
- 보안취약점
- component
- JS
- EXTJS
- javascript
- 스프링부트
- reactjs
- 리액트
- mssql
- Vue
- 자바스크립트
- table
- 데이터베이스
- 개발
- 스프링
- 개발공부
- springboot
- java
- Today
- Total
준준의 기록일지
[Java] resourcebundle 클래스 경로가 아닌 파일경로에서 가져오기. 본문
"이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다."
private static ResourceBundle fromClassLoader(String dir, String bundleName) throws MalformedURLException {
File file = new File(dir);
URL[] urls = {file.toURI().toURL()};
ClassLoader loader = new URLClassLoader(urls);
// Properties file name = test.properties. The .properties extension is appended to bundle name
return ResourceBundle.getBundle(bundleName, Locale.getDefault(), loader);
}
gist.github.com/mobleyc/73f1a0036d9ef3fdc7ab
Loading resource bundles in Java from property files outside of classpath, with different file extensions.
Loading resource bundles in Java from property files outside of classpath, with different file extensions. - app.java
gist.github.com