There is no standard way to do that you want with Java.