{info}
By Martin Jensby, Danish Data Archives
{info}
The most interesting part of the wrapper is the class dk.dda.fido.Fido, this one is actually the only class you really need to look at, when using this in your project.
Creating an object of it allows you to set more or less the parameters that you know from the cli of FIDO it self.
So your code could look something like this:
{code:java}
Fido fido = new Fido();
fido.setRecurse(true);
fido.setZip(true);
fido.setPathToInspect("c:\data");
{code}
Then you need to add something the wrapper can callback when it is done with the inspection, Code a class that implements the interface dk.dda.fido.callbacks.IFidoResultCallback
The reason for this is that we don't want the wrapper to "pause" the calling Thread, maybe this is call from a button or something.
{code:java}
fido.addCallback(yourClass);
{code}
Then you just need to call
{code:java}
fido.inspect();
{code}
When it is done you should receive a callback.
if you want to wait for the process to finish before the calling code continues you can call
{code:java}
fido.join()
{code}
This call even waits until after all the callbacks have executed.
The wrapper will also throw exceptions, in case the some of the parameters provided to the wrapper doesn't exist, e.g. the fido.py path.
By Martin Jensby, Danish Data Archives
{info}
The most interesting part of the wrapper is the class dk.dda.fido.Fido, this one is actually the only class you really need to look at, when using this in your project.
Creating an object of it allows you to set more or less the parameters that you know from the cli of FIDO it self.
So your code could look something like this:
{code:java}
Fido fido = new Fido();
fido.setRecurse(true);
fido.setZip(true);
fido.setPathToInspect("c:\data");
{code}
Then you need to add something the wrapper can callback when it is done with the inspection, Code a class that implements the interface dk.dda.fido.callbacks.IFidoResultCallback
The reason for this is that we don't want the wrapper to "pause" the calling Thread, maybe this is call from a button or something.
{code:java}
fido.addCallback(yourClass);
{code}
Then you just need to call
{code:java}
fido.inspect();
{code}
When it is done you should receive a callback.
if you want to wait for the process to finish before the calling code continues you can call
{code:java}
fido.join()
{code}
This call even waits until after all the callbacks have executed.
The wrapper will also throw exceptions, in case the some of the parameters provided to the wrapper doesn't exist, e.g. the fido.py path.