-
Notifications
You must be signed in to change notification settings - Fork 14
#26 Allow to download schema from http(s) #27
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
base: master
Are you sure you want to change the base?
Conversation
src/main/java/com/github/sylvainlaurent/maven/yamljsonvalidator/ValidateMojo.java
Outdated
Show resolved
Hide resolved
@wilx Could you accept this pull request ? |
Thank you @wilx |
Can anybody merge this PR ? |
import java.io.FileInputStream; | ||
import java.io.FileNotFoundException; | ||
import java.io.InputStream; | ||
import java.io.*; |
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.
Please don't use wildcard imports.
You can read more about it here: https://stackoverflow.com/questions/147454/why-is-using-a-wild-card-with-a-java-import-statement-bad
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(jsonSchemaFile); | ||
if (inputStream != null) { | ||
return inputStream; | ||
try { |
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.
Could you split up these into multiple, smaller methods? It's quite hard to read it this way.
I simply added the ability to download schemas from http using apache's HttpClient. This HttpClient can be configured using the system properties so it is possible to configure SSL, proxies, etc. this way.
I also added unit and integration tests.