private ExternalPermissionDefinition toExternalPermissionDefinition(
            String system, String activity) {
        ExternalPermissionDefinition def = ExternalPermissionDefinition.find(system, activity);
        if (def != null) {
            return def;
        }

        String delim = "";
        StringBuilder buffer = new StringBuilder();
        for (ExternalPermissionDefinition perm : ExternalPermissionDefinition.values()) {
            buffer.append(delim);
            buffer.append(perm.toString());
            delim = ", ";
        }

        throw new IllegalArgumentException(
                "Permission type "
                        + system
                        + "."
                        + activity
                        + " is not supported.  "
                        + "The only supported permissions at this time are: "
                        + buffer.toString());
    }
private ExternalPermissionDefinition toExternalPermissionDefinition ( String system , String activity ) { ExternalPermissionDefinition def = ExternalPermissionDefinition . find ( system , activity ) ; if ( def != null ) { return def ; } String delim = "" ; StringBuilder buffer = new StringBuilder ( ) ; for ( ExternalPermissionDefinition perm : ExternalPermissionDefinition . values ( ) ) { buffer . append ( delim ) ; buffer . append ( perm . toString ( ) ) ; delim = ", " ; } throw new IllegalArgumentException ( "Permission type " + system + "." + activity + " is not supported.  " + "The only supported permissions at this time are: " + buffer . toString ( ) ) ; }
Check that a permission type from the XML file matches with a real permission.

@param system The name of the permission manager
@param activity The name of the permission to search for.
@return the permission type string to use
@throws IllegalArgumentException if an unsupported permission type is specified