.properties
파일 확장자 | .properties |
---|---|
인터넷 미디어 타입 | text/plain |
.properties는 응용 프로그램의 구성 가능한 파라미터들을 저장하기 위해 자바 관련 기술을 주로 사용하는 파일들을 위한 파일 확장자이다. 국제화와 지역화를 위한 문자열들을 저장하는데 사용할 수도 있는데 이것을 Property Resource Bundles로 부른다.
각 파라미터는 문자열들의 일부로 저장되는데, 한 문자열은 파라미터의 이름(키)을 저장하며, 다른 하나는 값을 저장한다.
포맷
.properties의 각 줄은 일반적으로 하나의 프로퍼티를 저장한다. 키=값, 키 = 값, 키:값, 키 값과 같이 여러 형태가 올 수 있다.
.properties 파일에서 주석은 줄 맨 앞에 #이나 !로 시작하며, 이 때 해당 줄의 나머지 문자열들은 모두 무시된다. properties 파일의 예는 아래와 같다.
# You are reading the ".properties" entry. ! The exclamation mark can also mark text as comments. # The key and element characters #, !, =, and : are written with # a preceding backslash to ensure that they are properly loaded. website = http\://en.wikipedia.org/ language = English # The backslash below tells the application to continue reading # the value onto the next line. message = Welcome to \ Wikipedia! # Add spaces to the key key\ with\ spaces = This is the value that could be looked up with the key "key with spaces". # Unicode tab : \u0009
같이 보기
- 더 복잡한 설정 포맷을 원할 경우 XML와 YAML이 사용된다.
외부 링크
- Config::Properties - Perl CPAN.
- Lokalise Developer-friendly translation and localisation tool that supports .properties files.