There is no way to directly edit the InDesign files using Java. However, you can communicate with InDesign server using Java with CORBA. This Java usage is only for InDesign server and not for desktop version.
Also, note that Java with CORBA support is deprecated in InDesign CS6 server. You can open and edit the indd files in InDesign server using Java SOAP communication by leveraging the scripting DOM of InDesign.