Is it possible to implement a wrapper application for other (Java) applications using Java?
The goal is to apply usage policies for documents that are independent of the application used to work with a specific document.
eg. I have an encrypted file that needs to be decrypted and opened in some editor. Thus, the shell application decrypts the file and launches the editor within itself to ensure that the read-only policy is enforced, for example, by denying write access to the application. Therefore, the Runtime.getRuntime().exec(<command>)
method does not fit well :)
There are also some ways to intercept method calls in one application, but none of them will wrap the entire other application.
I also read about changing the JVM itself to intercept file access. That sounds good. But I need to dynamically change the policy depending on the user. Perhaps this will not work as far as I know.
I suppose there can be no way to do this using Java code, but I would appreciate any hints and help.
bandt source share