Francais | English | Espanõl

.properties

From Wikipedia, the free encyclopedia

Jump to: navigation, search
Properties <tr><th style="white-space: nowrap;">File extension:</th><td>.properties</td></tr><tr><th style="white-space: nowrap;">Type of format:</th><td>ASCII</td></tr>

.properties is a file extension for files mainly used in Java related technologies to store the configurable parameters of an application.

.properties files can use the number sign, '#', or the exclamation mark, '!', to denote that all text following it is a comment. The backwards slash is used to escape a character. An example of a properties file is provided below.

# You are reading the '.properties' entry in the English wikipedia.
! The exclamation mark can also mark text as comments.
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".

A .properties file maps a key with a value, it is essentially a hash table. In the example above, 'website' would be a key, and its corresponding value would be 'http://en.wikipedia.org'. Whilst the number sign and the exclamation mark marks text as comments, it has no effect when it is part of a property. Thus, the key 'message' has the value 'Welcome to Wikipedia!' and not 'Welcome to Wikipedia'. Note also that all of the whitespace in front of 'Wikipedia!' is excluded completely.


Personal tools