Java security policy: granting access depending on classloader
问题 I have an application that loads plugins (plain jar files) and runs code from them. The plugins are loaded using an URLClassLoader. I would like to prevent those plugings from accessing files and other resources, while retaining all permissions for my own code. Here are the two features by which plugin code is distinct from my own application and its libraries: 1) It is loaded by a URLClassLoader created for this purpose. 2) Its jar files are copied to a specific directory, from which the