public ResourceProviderInfo()

in src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderInfo.java [63:105]


    public ResourceProviderInfo(final ServiceReference<ResourceProvider> ref) {
        final Converter c = Converters.standardConverter();
        this.ref = ref;
        this.path = c.convert(ref.getProperty(ResourceProvider.PROPERTY_ROOT))
                .defaultValue("")
                .to(String.class);
        this.name = c.convert(ref.getProperty(ResourceProvider.PROPERTY_NAME)).to(String.class);
        this.useResourceAccessSecurity = c.convert(
                        ref.getProperty(ResourceProvider.PROPERTY_USE_RESOURCE_ACCESS_SECURITY))
                .to(boolean.class);
        final String authType = c.convert(ref.getProperty(ResourceProvider.PROPERTY_AUTHENTICATE))
                .defaultValue(AuthType.no.name())
                .to(String.class);
        AuthType aType = null;
        try {
            aType = AuthType.valueOf(authType);
        } catch (final IllegalArgumentException iae) {
            logger.error("Illegal auth type {} for resource provider {} ({})", authType, name, ref);
        }
        this.authType = aType;
        this.modifiable =
                c.convert(ref.getProperty(ResourceProvider.PROPERTY_MODIFIABLE)).to(boolean.class);
        this.adaptable =
                c.convert(ref.getProperty(ResourceProvider.PROPERTY_ADAPTABLE)).to(boolean.class);
        this.refreshable = c.convert(ref.getProperty(ResourceProvider.PROPERTY_REFRESHABLE))
                .to(boolean.class);
        this.attributable = c.convert(ref.getProperty(ResourceProvider.PROPERTY_ATTRIBUTABLE))
                .to(boolean.class);
        final String modeValue = c.convert(ref.getProperty(ResourceProvider.PROPERTY_MODE))
                .defaultValue(ResourceProvider.MODE_OVERLAY)
                .to(String.class)
                .toUpperCase();
        Mode mode = null;
        try {
            mode = Mode.valueOf(modeValue);
        } catch (final IllegalArgumentException iae) {
            logger.error("Illegal mode {} for resource provider {} ({})", modeValue, name, ref);
        }
        this.mode = mode;
        if (!path.startsWith("/")) {
            logger.error("Path {} does not start with / for resource provider {} ({})", path, name, ref);
        }
    }