All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.smallframework.spring.path.SpringClassPathScanningServiceImpl Maven / Gradle / Ivy

The newest version!
package org.smallframework.spring.path;

import java.io.IOException;
import java.net.URL;
import java.util.Set;

/**
 * spring-core中的实现
 */
public class SpringClassPathScanningServiceImpl implements ClassPathScanningService {
    @Override
    public Set getClassResourcesURL(URL rootClasspath, String... scanPackageArr) {
        return SpringClassPathScanning.getClassResources(resource -> {
            try {
                return resource.getURL();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        },rootClasspath, scanPackageArr);
    }

    @Override
    public Set getResourcesURL(URL rootClasspath, String... locationPatterns) {
        return SpringClassPathScanning.getResources(resource -> {
            try {
                return resource.getURL();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        },rootClasspath, locationPatterns);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy