Package org.springframework.core.io.support

Examples of org.springframework.core.io.support.ResourcePatternResolver


    }

    /** 扩展<code>ResourcePatternResolver</code>机制,实现自定义的资源装载。 */
    @Override
    protected ResourcePatternResolver getResourcePatternResolver() {
        final ResourcePatternResolver defaultResolver = super.getResourcePatternResolver();

        return new ResourcePatternResolver() {
            public Resource[] getResources(String locationPattern) throws IOException {
                ResourcePatternResolver resolver = null;

                if (resourceLoadingExtender != null) {
                    resolver = resourceLoadingExtender.getResourcePatternResolver();
                }

                if (resolver == null) {
                    resolver = defaultResolver;
                }

                return resolver.getResources(locationPattern);
            }

            public ClassLoader getClassLoader() {
                return defaultResolver.getClassLoader();
            }
View Full Code Here


        properties.setProperty(RUNTIME_LOG_LOGSYSTEM, new Slf4jLogChute(log));
    }

    /** 查找所有全局macros。 */
    private void initMacros() throws Exception {
        ResourcePatternResolver resolver;

        if (loader instanceof ResourcePatternResolver) {
            resolver = (ResourcePatternResolver) loader;
        } else {
            resolver = new PathMatchingResourcePatternResolver(loader);
View Full Code Here

            if (scriptResourceName != null) {
                scriptResourceName = prefix == null ? scriptResourceName : prefix + ":" + scriptResourceName;

                // 扫描scripts
                ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(parserContext
                                                                                                   .getReaderContext().getResourceLoader());
                int found = 0;

                try {
                    Resource[] resources = resolver.getResources(scriptResourceName.replace('?', '*'));
                    BeanDefinitionDefaults defaults = getBeanDefinitionDefaults(subElement, parserContext);
                    ParsingModuleMatcher matcher = new ParsingModuleMatcher(scripts, scriptNamePattern, typeName,
                                                                            moduleName) {
                        @Override
                        protected String getName(String name, String itemName) {
View Full Code Here

    }

    /** 扩展<code>ResourcePatternResolver</code>机制,实现自定义的资源装载。 */
    @Override
    protected ResourcePatternResolver getResourcePatternResolver() {
        final ResourcePatternResolver defaultResolver = super.getResourcePatternResolver();

        return new ResourcePatternResolver() {
            public Resource[] getResources(String locationPattern) throws IOException {
                ResourcePatternResolver resolver = null;

                if (resourceLoadingExtender != null) {
                    resolver = resourceLoadingExtender.getResourcePatternResolver();
                }

                if (resolver == null) {
                    resolver = defaultResolver;
                }

                return resolver.getResources(locationPattern);
            }

            public ClassLoader getClassLoader() {
                return defaultResolver.getClassLoader();
            }
View Full Code Here

        Map<String, String> componentNamesAndLocations = createTreeMap();

        if (componentsConfig.isAutoDiscoverComponents()) {
            try {
                ResourcePatternResolver resolver = new ServletContextResourcePatternResolver(servletContext);
                Resource[] componentConfigurations = resolver.getResources(locationPattern);
                Pattern pattern = compilePathName(pathPattern);

                if (componentConfigurations != null) {
                    for (Resource resource : componentConfigurations) {
                        String path = resource.getURL().getPath();
View Full Code Here

    /**
     * ��������ȫ��macros��
     */
    private void initMacros() throws Exception {
        ResourcePatternResolver resolver;

        if (loader instanceof ResourcePatternResolver) {
            resolver = (ResourcePatternResolver) loader;
        } else {
            resolver = new PathMatchingResourcePatternResolver(loader);
View Full Code Here

            if (scriptResourceName != null) {
                scriptResourceName = prefix == null ? scriptResourceName : prefix + ":" + scriptResourceName;

                // ɨ��scripts
                ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(parserContext
                        .getReaderContext().getResourceLoader());
                int found = 0;

                try {
                    Resource[] resources = resolver.getResources(scriptResourceName.replace('?', '*'));
                    BeanDefinitionDefaults defaults = getBeanDefinitionDefaults(subElement, parserContext);
                    ParsingModuleMatcher matcher = new ParsingModuleMatcher(scripts, scriptNamePattern, typeName,
                            moduleName) {
                        @Override
                        protected String getName(String name, String itemName) {
View Full Code Here

    /**
     * ��չ<code>ResourcePatternResolver</code>���ƣ�ʵ���Զ������Դװ�ء�
     */
    @Override
    protected ResourcePatternResolver getResourcePatternResolver() {
        final ResourcePatternResolver defaultResolver = super.getResourcePatternResolver();

        return new ResourcePatternResolver() {
            public Resource[] getResources(String locationPattern) throws IOException {
                ResourcePatternResolver resolver = null;

                if (resourceLoadingExtender != null) {
                    resolver = resourceLoadingExtender.getResourcePatternResolver();
                }

                if (resolver == null) {
                    resolver = defaultResolver;
                }

                return resolver.getResources(locationPattern);
            }

            public ClassLoader getClassLoader() {
                return defaultResolver.getClassLoader();
            }
View Full Code Here

    /**
     * ��չ<code>ResourcePatternResolver</code>���ƣ�ʵ���Զ������Դװ�ء�
     */
    @Override
    protected ResourcePatternResolver getResourcePatternResolver() {
        final ResourcePatternResolver defaultResolver = super.getResourcePatternResolver();

        return new ResourcePatternResolver() {
            public Resource[] getResources(String locationPattern) throws IOException {
                ResourcePatternResolver resolver = null;

                if (resourceLoadingExtender != null) {
                    resolver = resourceLoadingExtender.getResourcePatternResolver();
                }

                if (resolver == null) {
                    resolver = defaultResolver;
                }

                return resolver.getResources(locationPattern);
            }

            public ClassLoader getClassLoader() {
                return defaultResolver.getClassLoader();
            }
View Full Code Here

        Map<String, String> componentNamesAndLocations = createTreeMap();

        if (componentsConfig.isAutoDiscoverComponents()) {
            try {
                ResourcePatternResolver resolver = new ServletContextResourcePatternResolver(servletContext);
                Resource[] componentConfigurations = resolver.getResources(locationPattern);
                Pattern pattern = compilePathName(pathPattern);

                if (componentConfigurations != null) {
                    for (Resource resource : componentConfigurations) {
                        String path = resource.getURL().getPath();
View Full Code Here

TOP

Related Classes of org.springframework.core.io.support.ResourcePatternResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.