This shouldn't matter for the applet, you can simply use the URL with the file ID. However, what your problem most likely will be is that files are secured by entity access. This means you will need a valid session with a user that has access to this file to retrieve it. Obviously there is no way around this as it would defeat the purpose of security.
In this case the applet should also send the XSRF token for the client. If you're not familiar with this concept, this is a protective measure against cross-site request forgery
Another way to do this would be by writing your own request handler that serves files based on a path and name. This would require some java coding and you would really need to keep security in mind, for example by creating an entity type specifically designed for these files so it doesn't become a problem that everyone can download them.