-
Notifications
You must be signed in to change notification settings - Fork 16
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
965 schemas for inreach cmd populate schema folder #1141
965 schemas for inreach cmd populate schema folder #1141
Conversation
…lt user input for schema create as 'N'
// Write JSON to file | ||
File file = new File(schemaDir, "definition.json"); | ||
try { | ||
FileOutputStream fos = new FileOutputStream(file); |
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.
Don't need the flush statements (close flushes, and these aren't buffered writers anyway).
Can we switch this all over the try-with-resource
pattern? That was introduced to make the closing of streams better/cleaner and handle exceptions better. This stack overflow shows multiple stream try-with-resource https://stackoverflow.com/questions/41248572/sonar-how-to-use-try-with-resources-to-close-fileoutputstream
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.
…hemas-for-inreach-cmd-populate-schema-folder
This fix helps to pass --add-schema flag to create schema for inReach forms with schemas-for-inreach command.
If the flag is not passed it asks the user if they want to create a schema or not. create schema if users answers "yes", else just print out the JSON definition.