It is not generally recommended to access files directly. You can get contents of files via
Core.getFileDocumentContent
which returns an InputStream. If you really need a file, I would recommend copying that InputStream to a Temporary File that you can then pass to whatever library you're using.