private void init()

in resolver/src/main/java/org/apache/james/jspf/impl/DefaultTermsFactory.java [64:100]


    private void init() {
        try {
            InputStream is = Thread.currentThread().getContextClassLoader()
                    .getResourceAsStream(termFile);
            if (is == null) {
                throw new NullPointerException("Unable to find the "+termFile+" resource in the classpath");
            }
            Properties p = new Properties();
            p.load(is);
            String mechs = p.getProperty("mechanisms");
            String mods = p.getProperty("modifiers");
            String[] classes;
            classes = mechs.split(",");
            Class<?>[] knownMechanisms = new Class[classes.length];
            for (int i = 0; i < classes.length; i++) {
                LOGGER.debug("Add following class as known mechanismn: {}", classes[i]);
                knownMechanisms[i] = Thread.currentThread()
                        .getContextClassLoader().loadClass(classes[i]);
            }
            mechanismsCollection = createTermDefinitionCollection(knownMechanisms);
            classes = mods.split(",");
            Class<?>[] knownModifiers = new Class[classes.length];
            for (int i = 0; i < classes.length; i++) {
                LOGGER.debug("Add following class as known modifier: {}", classes[i]);
                knownModifiers[i] = Thread.currentThread()
                        .getContextClassLoader().loadClass(classes[i]);
            }
            modifiersCollection = createTermDefinitionCollection(knownModifiers);
    
        } catch (IOException e) {
            throw new IllegalStateException(
                    "Term configuration cannot be found");
        } catch (ClassNotFoundException e) {
            throw new IllegalStateException(
                    "One configured class cannot be found");
        }
    }