I have a use case where I need to use the ArgoFormatChecker as part of a larger Java application. The current project does not lend itself well to this for the following reasons:
- Use of System.exit() outside of the main class / method. This will kill any process using this library.
- Abundant use of static variables makes this not thread safe
- The shaded jar is problematic when being used as a dependency
- Mixed use of log4j and slf4j. Consistent use of slf4j would allow for the use of different logging implementations in the containing application.
I've forked the project and created a branch that addresses these issues while still maintaining the ability of the shaded jar to work as a command line application. The branch is here: https://github.com/CI-CMG/ArgoFormatChecker/tree/file-checker-library
This branch also updates the code that writes the XML file to use JAXB classes generated from a XSD defined XML schema. I currently use this library to parse the output of the ArgoFormatChecker (https://github.com/CI-CMG/argo-file-check-xml/blob/1.0/src/main/resources/edu/colorado/cires/argonaut/xml/FileCheckResults.xsd).
I would be happy to discuss creating a pull request for these changes.
I have a use case where I need to use the ArgoFormatChecker as part of a larger Java application. The current project does not lend itself well to this for the following reasons:
I've forked the project and created a branch that addresses these issues while still maintaining the ability of the shaded jar to work as a command line application. The branch is here: https://github.com/CI-CMG/ArgoFormatChecker/tree/file-checker-library
This branch also updates the code that writes the XML file to use JAXB classes generated from a XSD defined XML schema. I currently use this library to parse the output of the ArgoFormatChecker (https://github.com/CI-CMG/argo-file-check-xml/blob/1.0/src/main/resources/edu/colorado/cires/argonaut/xml/FileCheckResults.xsd).
I would be happy to discuss creating a pull request for these changes.