Concept

.properties

Summary
.properties is a for mainly used in Java-related technologies to store the configurable parameters of an application. They can also be used for storing strings for Internationalization and localization; these are known as Property Resource Bundles. Each parameter is stored as a pair of strings, one storing the name of the parameter (called the key), and the other storing the value. Unlike many popular file formats, there is no RFC for .properties files and specification documents are not always clear, most likely due to the simplicity of the format. Each line in a .properties file normally stores a single property. Several formats are possible for each line, including key=value, key = value, key:value, and key value. Single-quotes or double-quotes are considered part of the string. Trailing space is significant and presumed to be trimmed as required by the consumer. Comment lines in .properties files are denoted by the number sign (#) or the exclamation mark (!) as the first non blank character, in which all remaining text on that line is ignored. The backwards slash is used to escape a character. An example of a properties file is provided below.

You are reading a comment in ".properties" file.

! The exclamation mark can also be used for comments.

Lines with "properties" contain a key and a value separated by a delimiting character.

There are 3 delimiting characters: '=' (equal), ':' (colon) and whitespace (space, \t and \f).

website = https://en.wikipedia.org/ language : English topic .properties files

A word on a line will just create a key with no value.

empty

White space that appears between the key, the value and the delimiter is ignored.

This means that the following are equivalent (other than for readability).

hello=hello hello = hello

Keys with the same name will be overwritten by the key that is the furthest in a file.

For example the final value for "duplicateKey" will be "second".

duplicateKey = first duplicateKey = second

To use the delimiter characters inside a key, you need to escape them with a .

About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.
Related publications

Loading

Related people

Loading

Related units

Loading

Related concepts

Loading

Related courses

Loading

Related lectures

Loading

Related MOOCs

Loading