private List<Resource> getResources(String locationPattern) throws IOException {
        Set<Resource> resources = new HashSet<Resource>();
        String rootDirPath = determineRootDir(locationPattern);
        String subPattern = locationPattern.substring(rootDirPath.length());

        if (rootDirPath.startsWith(CLASSPATH_ALL_URL_PREFIX)) { // 包含jar中的文件
            String findDirPath = rootDirPath.substring(CLASSPATH_ALL_URL_PREFIX.length());
            findDirPath = processPath(findDirPath);
            Enumeration<URL> urls = classloader.getResources(findDirPath);
            while (urls.hasMoreElements()) {
                URL url = urls.nextElement();
                String protocol = url.getProtocol();
                if (PROTOCOL_JAR.equals(protocol)) {
                    resources.addAll(findJarResource(url, findDirPath, subPattern));
                } else {
                    resources.addAll(findClasspathResource(url, findDirPath, subPattern));
                }
            }
        } else if (rootDirPath.startsWith(CLASSPATH_URL_PREFIX)) { // 不包含jar中的文件
            String findDirPath = rootDirPath.substring(CLASSPATH_URL_PREFIX.length());
            URL url = classloader.getResource(findDirPath);
            resources.addAll(findClasspathResource(url, findDirPath, subPattern));
        } else { // 单一文件
            resources.add(new Resource(locationPattern));
        }

        return new ArrayList<Resource>(resources);
    }