Property class

Properties class, it almost my favour class when building my own side project. It come into handy because Java help dev to store information in a file with pre-defined format. Which mean not need to write method(handler) for fetch && save data by ourself.

In order to retrieve information from file, you need “FileInputeStream” with path as constructer. Code list as below:

Screen Shot 2017-02-03 at 2.39.04 PM.png

After Properties load data successfully, field can be manipulated by .setProperty / .remove method call.

Screen Shot 2017-02-03 at 2.40.42 PM.png

Of cause, password shouldn’t be store in plaintext form.

After all operation been done, .store used to write all the change in specific file path. Screen Shot 2017-02-03 at 2.43.02 PM.png

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s