REST wrappings for JHOVE, provides:
- JAXB REST resources for JHOVE validation
- Dropwizard application server
- Basic Web GUI implementation
You'll need Java 8 or greater and Maven to build the project.
- Clone this repo:
git clone [email protected]:openpreserve/jhove-rest.git
- Drop into project directory:
cd jhove-rest
- Compile and package via Maven
mvn clean package
From the cloned project directory to start the jetty server:
java -jar jhove-rest-server/target/jhove-rest-server-0.0.1-SNAPSHOT.jar server jhove-rest.yml
Using CURL:
curl localhost:8080/api/jhove
{"version":"1.22.1","buildDate":1556547671000,"rights":"Derived from software Copyright 2004-2011 by the President and Fellows of Harvard College. Version 1.7 to 1.11 independently released. Version 1.12 onwards released by Open Preservation Foundation. Released under the GNU Lesser General Public License."}
Open a browser and visit http://localhost:8080/
Go to http://localhost:8080/api/swagger#/jhove in your browser to see the swagger documentation of the API and try it.
To validate a local file ./tmp/test.jpg
use the following CURL command:
curl -F "file=@tmp/test.jpg" -F "module=JPEG-hul" localhost:8080/api/jhove/validate -H "Accept:application/xml"
If you prefer JSON results:
curl -F "file=@tmp/test.jpg" -F "module=JPEG-hul" localhost:8080/api/jhove/validate -H "Accept:application/xml"
The version of the JHOVE modules used to build the rest server are all held within pom.xml
. Change the versions here to those required and rebuild the project.