Skip to content
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 syntax from file name parser option #573

Merged
merged 2 commits into from
Jul 25, 2018
Merged

Add syntax from file name parser option #573

merged 2 commits into from
Jul 25, 2018

Conversation

ntviet18
Copy link
Contributor

Fix #572

Add parse option to guess syntax from given file name similar to ConfigFactory.parseFile

Copy link
Collaborator

@havocp havocp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Might add the "else" there, but otherwise don't see any issue. Thanks for writing tests!

public static ConfigSyntax syntaxFromExtension(String filename) {
if (filename == null)
return null;
if (filename.endsWith(".json"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be an "else if" I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I forgot to add that, will do it in a moment

@havocp havocp merged commit 7b9e153 into lightbend:master Jul 25, 2018
@2m 2m added this to the 1.3.4 milestone Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot guess syntax from reader
3 participants