@SuppressWarnings("unchecked") private Class<? extends Authorizer> loadAuthorizerClass(File authorizerExtensionJar) throws IOException, InvalidAuthorizerException { String authorizerClassName = getAuthorizerClassName(authorizerExtensionJar); Class<?> authorizerClass; try { authorizerClass = authorizerClassLoader.loadClass(authorizerClassName); } catch (ClassNotFoundException e) { throw new InvalidAuthorizerException( String.format("Authorizer extension class %s not found. Please make sure that the right class is specified " + "in the extension jar's manifest located at %s.", authorizerClassName, authorizerExtensionJar), e); } if (!Authorizer.class.isAssignableFrom(authorizerClass)) { throw new InvalidAuthorizerException( String.format("Class %s defined as %s in the authorization extension's manifest at %s must implement %s", authorizerClass.getName(), Attributes.Name.MAIN_CLASS, authorizerExtensionJar, Authorizer.class.getName())); } return (Class<? extends Authorizer>) authorizerClass; }