Hi Nisha Saini,
You will have to Pass a file Document object to the Java action.
To create a File Document entity- Create an Entity ‘A’ And Generalize the entity with System.FileDocument.
Now in your Microflow use Crete object Action, create an Object for Entity ‘A’ and Pass it to the GenerateDocument Java action.
Hope it helps!!!