A public java.util.Collection<Sring> Server.getAllPermissionGroups() method would be useful. It would return a collection of all the same strings used in Player.getPermissionGroup() and Player.setPermissionGroup().
It can be probably implemented in a plug-in, assuming that the "../../"+plugin.getPath()+"permissions" directory is readable to the plug-in (which should be true, as the plug-in is run within the same process of the whole game), but having it ready-made would cut a few edges and avoid to be tied to current implementation details which may change in the future (directory structure, file naming, ...).