Is it possible to implement a wrapper application for other (Java) applications using Java?
The purpose is to enforce usage policies for documents independent of the application used to work with a specific document.
E.G. I have an encrypted file that needs to be decrypted and opened in some kind of editor. So the wrapper application would decrypt the file and start the editor within itself to enforce an read-only policy by denying the write-access to the application, for example. Therefore the Runtime.getRuntime().exec(<command>)
method doesn't fit well :)
There are also some ways to intercept method invocations within the same application but none that would wrap a whole other application.
I've also read about altering the JVM itself to intercept the file access. That sounds pretty good. But I need to dynamically change the policy depending on a user. That might not work as far as I know by now.
I guess there might not be any way to do this using Java code, but I'd appreciate any kind of hints and help.