Skip to content

Repository files navigation

JavaPropertiesTokenizer

JavaPropertiesTokenizer is a .NET library for tokenizing Java properties files.

It lets you load a Java properties file, edit it and write back the changes. It preseves the whitespace and separator characters so that the file can be faithfully recrated.

Usage

usingJavaPropertiesTokenizer;// Basic reading of properties file to get only key value pairsDictionary<string,string>props=JavaPropertiesParser.ParseFileToDictionary(@"C:\Path\File.properties");// orDictionary<string,string>props=JavaPropertiesParser.ParseFileToDictionary(@"C:\Path\File.properties",JavaPropertiesParser.DefaultEncoding,true);// Reading tokens of a properties fileusingvarfileStream=File.Open(@"C:\Path\File.properties",FileMode.Open,FileAccess.Read,FileShare.ReadWrite);varfileTokens=JavaPropertiesParser.Parse(fileStream);// Writing tokens to a properties fileusing(varwriter=newStreamWriter(@"C:\Path\File2.properties",false,JavaPropertiesParser.DefaultEncoding)){JavaPropertiesWriter.Write(writer,fileTokens);}

License

This library is licensed under the MIT license.

About

A .NET library for tokenizing Java properties files

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages