GithubHelp home page GithubHelp logo

erezwanderman / javapropertiestokenizer Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 13 KB

A .NET library for tokenizing Java properties files

License: MIT License

C# 100.00%
java-properties java-property-file java-props

javapropertiestokenizer's Introduction

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

using JavaPropertiesTokenizer;

// Basic reading of properties file to get only key value pairs
Dictionary<string, string> props = JavaPropertiesParser.ParseFileToDictionary(@"C:\Path\File.properties");
// or
Dictionary<string, string> props = JavaPropertiesParser.ParseFileToDictionary(@"C:\Path\File.properties", JavaPropertiesParser.DefaultEncoding, true);

// Reading tokens of a properties file
using var fileStream = File.Open(@"C:\Path\File.properties", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
var fileTokens = JavaPropertiesParser.Parse(fileStream);

// Writing tokens to a properties file
using (var writer = new StreamWriter(@"C:\Path\File2.properties", false, JavaPropertiesParser.DefaultEncoding))
{
    JavaPropertiesWriter.Write(writer, fileTokens);
}

License

This library is licensed under the MIT license.

javapropertiestokenizer's People

Contributors

erezwanderman avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.