-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add one param to set charset when read Properties file #93
add one param to set charset when read Properties file #93
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default the jvm states that property files should be in ISO 8859-1 character encoding.
If you need to deviate from that standard I suggest adding an encoding
parameter to the step.
69bf86a
to
35c44b8
Compare
if(StringUtils.isEmpty(step.getEncoding())){ | ||
properties.load(is); | ||
} else { | ||
properties.load( new BufferedReader(new InputStreamReader(is, step.getEncoding()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to close the streams or it will break things, especially on windows.
Something like above:
properties.load( new BufferedReader(new InputStreamReader(is, step.getEncoding()))); | |
try(InputStreamReader is = new InputStreamReader(is, step.getEncoding()); BufferedReader br = new BufferedReader(is)) { | |
properties.load(br); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I missed it last time; there is a config.jelly you need to add the new parameter to as well, so that the snippet generator works.
Besides that it all looks good.
78a344d
to
fb0f2c4
Compare
</f:entry> | ||
<f:entry title="${%interpolate.title}" field="interpolate" description="${%interpolate.description}"> | ||
<f:checkbox /> | ||
</f:entry> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added everything but the charset parameter?
Signed-off-by: bright.ma RMSH06 <bright.ma@blackshark.com>
or it will break things, especially on windows. Change-Id: Icc7a9a393d4fae9d546239f3545caf256f3a5b78 Signed-off-by: bright.ma <bright.ma@blackshark.com>
Keep the style same as WriteYamlStep
resources: update ReadPropertiesStep config.jelly for snippet generator
Change-Id: I5e2952cd3c4c92f7966bb7bc3be47a7042af27f3
fb0f2c4
to
de2145a
Compare
Signed-off-by: bright.ma RMSH06 bright.ma@blackshark.com
add one param to set charset when read Properties file