public static boolean registerNodeType()

in src/main/java/org/apache/sling/jcr/base/NodeTypeLoader.java [64:95]


    public static boolean registerNodeType(Session session, URL source) {

        // Access the node type definition file, "fail" if not available
        if (source == null) {
            log.info("No node type definition source available");
            return false;
        }

        InputStream ins = null;
        try {
            ins = source.openStream();
            return registerNodeType(session, ins);
        } catch (IOException ioe) {
            log.error("Cannot register node types from " + source, ioe);
        } catch (RepositoryException re) {
            if(isReRegisterBuiltinNodeType(re)) {
                log.debug("Attempt to re-register built-in node type from " + source, re);
            } else {
                log.error("Cannot register node types from " + source, re);
            }
        } finally {
            if (ins != null) {
                try {
                    ins.close();
                } catch (IOException ignore) {
                }
            }
        }

        // fall back to failure, reason has been logged
        return false;
    }