Hi there

I have a lucene package which indexes files using the following command

java org.apache.lucene.demo.IndexFiles

Now I can use this on the command line but I would like to make some java code that automatically interacts with this code .

That line accepts two parameters in the following way:

java org.apache.lucene.demo.IndexFiles -docs "path where your corpus resides" -index "path

where you want the created index files to be saved"

How can I make some code in java so that I call that line and pass it the following parameters :

-docs accepts the path where I have the file with my data, do I have necessarily have to pass it the path or can I also load the data I want to process in a variable and pass that variable as a file to the indexFiles class?

If not, how can I run that class using java code ?

Thank you