Could you provide some more info about your case and the need the need to add java file directly in the platforms folder? It would also help if you provide info, what is the expected final result.
In the meantime, In case you need to expose some native class, I would suggest creating your own NaiiveScript plugin, which exposes the needed native methods and classes. For your help, you could review this article here
and as a starting point, you could use nativescript-plugin-seed