-
Notifications
You must be signed in to change notification settings - Fork 5
Example Code
How to use the example code
This project also contains an example of the usage of a Service Provider Interface and how to use the @ProviderFor
annotation to ease development.
Install Example explains how to get the example code on your machine.
The projects come tailor made for use in eclipse, so just run the Thumbnailer launch target and the program will execute.
If you checked the program out via command line svn or downloaded the source archive the easiest way to compile the example is using Apache Ant. If you do not have it installed you can get it at http://ant.apache.org/. The thumbnails directory contains an ant build file which can be used to compile the source code in one go.
Once all the files have been compiled you can run the program using
java -cp <classpath_containing_implementations_of_renderers> Thumbnailer <file_1> [<file_2>...<file_n>]
Whichever method you run the program, if all has gone correctly the standard output (Console) will receive:
Using renderer 'Renderer for ordinary image files' for 'sample-image.jpg'
Successfully created 'sample-image.jpg-thumb.png' for 'sample-image.jpg'
and the file sample-image.jpg-thumb.png will have been created in the current directory.
An exact walkthrough of the example code can be found in the Example Code Rundown