pnoltes opened a new issue, #685:
URL: https://github.com/apache/celix/issues/685

   # Clarify and improve parsing of the .properties file format
   Apache Celix uses a .properties file to store and read configurable - 
framework and bundle - parameters. 
   
   The Apache Celix .properties file format is based on the Java .properties 
file format.
   There is no RFC or clear specification document for the Java .properties 
file format, but there is a wikipedia page 
https://en.wikipedia.org/wiki/.properties
   
   .properties file example in the wikipedia:
   ```
   # 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 \.
   # However, there is no need to do this in the value.
   delimiterCharacters\:\=\ = This is the value for the key 
"delimiterCharacters\:\=\ "
   # Adding a \ at the end of a line means that the value continues to the next 
line.
   multiline = This line \
   continues
   # If you want your value to include a \, it should be escaped by another \.
   path = c:\\wiki\\templates
   # This means that if the number of \ at the end of the line is even, the 
next line is not included in the value. 
   # In the following example, the value for "evenKey" is "This is on one 
line\".
   evenKey = This is on one line\\
   # This line is a normal comment and is not included in the value for 
"evenKey"
   # If the number of \ is odd, then the next line is included in the value.
   # In the following example, the value for "oddKey" is "This is line one 
and\#This is line two".
   oddKey = This is line one and\\\
   # This is line two
   # White space characters are removed before each line.
   # Make sure to add your spaces before your \ if you need them on the next 
line.
   # In the following example, the value for "welcome" is "Welcome to 
Wikipedia!".
   welcome = Welcome to \
             Wikipedia!
   # If you need to add newlines and carriage returns, they need to be escaped 
using \n and \r respectively.
   # You can also optionally escape tabs with \t for readability purposes.
   valueWithEscapes = This is a newline\n and a carriage return\r and a tab\t.
   # You can also use Unicode escape characters (maximum of four hexadecimal 
digits).
   # In the following example, the value for "encodedHelloInJapanese" is 
"こんにちは".
   encodedHelloInJapanese = \u3053\u3093\u306b\u3061\u306f
   # But with more modern file encodings like UTF-8, you can directly use 
supported characters.
   helloInJapanese = こんにちは
   ```
   
   
   ## Clarify Apache Celix .properties file format
   Write down a specification for the .properties file format. This does not 
have to be formal (EBNF), but should make it clear for users what is and is not 
possible with a .properties file.
   
   ## Refactor .properties file parsing
   The current parsing of .properties file is not ideal (parsing can lead to 
many allocation) and this should be improved.
   The `manifest_readFromStream` can be used as input for the refactoring. 
   
   A possible choice could be to to support multiple key/value delimiters (`=` 
and `:`) and then extract and extend the `manifest_readFromStream` to be used 
in properties and manifest handling. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to