convertedPaths[i] = ResourceUtils.CLASSPATH_URL_PREFIX + path; else if (!ResourcePatternUtils.isUrl(path)) { convertedPaths[i] = ResourceUtils.CLASSPATH_URL_PREFIX + SLASH + StringUtils.cleanPath(ClassUtils.classPackageAsResourcePath(clazz) + SLASH + path);
absoluteLocation = ResourcePatternUtils.isUrl(location) || ResourceUtils.toURI(location).isAbsolute();
absoluteLocation = ResourcePatternUtils.isUrl(location) || ResourceUtils.toURI(location).isAbsolute();
if (!ResourcePatternUtils.isUrl(resourceLocation)) { resourceLocation = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + resourceLocation;
absoluteLocation = ResourcePatternUtils.isUrl(location) || ResourceUtils.toURI(location).isAbsolute();
private Collection<Class<?>> resolveClassesFromResourcePatterns(final String pattern) throws IOException, ClassNotFoundException { final Collection<Class<?>> classes = new ArrayList<Class<?>>(); if (ResourcePatternUtils.isUrl(pattern)) { final Resource[] resources = resourcePatternResolver.getResources(pattern); for (final Resource resource : resources) { final URL url = resource.getURL(); LOGGER.debug("Resolving Class Name for URL: {}", url.toString()); final String className = resolveClassFromPath(url.toString()); LOGGER.debug("Finding @Test methods in class with Name: {}", className); addIfNeedBe(classes, className); } } return classes; }
if (!ResourcePatternUtils.isUrl(resourceLocation)) { resourceLocation = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + resourceLocation;
if (!ResourcePatternUtils.isUrl(resourceLocation)) { resourceLocation = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + resourceLocation;
/** * Generate a modified version of the supplied location and returns it. * <p> * A plain path, e.g. "myDataSet.xml", will be treated as a classpath resource from the same package in * which the specified class is defined. A path starting with a slash is treated as a fully qualified class path * location, e.g.: "/com/example/whatever/foo.xml". A path which references a URL (e.g., a path prefixed * with {@link ResourceUtils#CLASSPATH_URL_PREFIX classpath:}, {@link ResourceUtils#FILE_URL_PREFIX file:}, * <code>http:</code>, etc.) will be added to the results unchanged. * <p> * Subclasses can override this method to implement a different <em>location modification</em> strategy. * * @param clazz the class with which the locations are associated * @param locations the resource location to be modified * @return the modified application context resource location */ private String getRealLocationByConventions(Class<?> clazz, String location) { String modifiedLocation = null; if (location.startsWith("/")) { modifiedLocation = ResourceUtils.CLASSPATH_URL_PREFIX + location; } else if (!isUrl(location)) { modifiedLocation = ResourceUtils.CLASSPATH_URL_PREFIX + cleanPath(classPackageAsResourcePath(clazz) + "/" + location); } else { modifiedLocation = cleanPath(location); } return modifiedLocation; }
convertedPaths[i] = ResourceUtils.CLASSPATH_URL_PREFIX + path; else if (!ResourcePatternUtils.isUrl(path)) { convertedPaths[i] = ResourceUtils.CLASSPATH_URL_PREFIX + SLASH + StringUtils.cleanPath(ClassUtils.classPackageAsResourcePath(clazz) + SLASH + path);
convertedPaths[i] = ResourceUtils.CLASSPATH_URL_PREFIX + path; else if (!ResourcePatternUtils.isUrl(path)) { convertedPaths[i] = ResourceUtils.CLASSPATH_URL_PREFIX + SLASH + StringUtils.cleanPath(ClassUtils.classPackageAsResourcePath(clazz) + SLASH + path);
/** * Parse an "import" element and load the bean definitions * from the given resource into the bean factory. */ protected void importBeanDefinitionResource(Element ele) throws BeanDefinitionStoreException { String location = ele.getAttribute(RESOURCE_ATTRIBUTE); // Resolve system properties: e.g. "${user.dir}" location = SystemPropertyUtils.resolvePlaceholders(location); if (ResourcePatternUtils.isUrl(location)) { int importCount = getBeanDefinitionReader().loadBeanDefinitions(location); if (logger.isDebugEnabled()) { logger.debug("Imported " + importCount + " bean definitions from URL location [" + location + "]"); } } else { // No URL -> considering resource location as relative to the current file. try { Resource relativeResource = getResource().createRelative(location); int importCount = getBeanDefinitionReader().loadBeanDefinitions(relativeResource); if (logger.isDebugEnabled()) { logger.debug("Imported " + importCount + " bean definitions from relative location [" + location + "]"); } } catch (IOException ex) { throw new BeanDefinitionStoreException( "Invalid relative resource location [" + location + "] to import bean definitions from", ex); } } }
if (ResourcePatternUtils.isUrl(location))
if (ResourcePatternUtils.isUrl(location)) { int importCount = getReaderContext().getReader().loadBeanDefinitions(location); if (logger.isDebugEnabled()) {
if (ResourcePatternUtils.isUrl(location)) { int importCount = getReaderContext().getReader().loadBeanDefinitions(location); if (logger.isDebugEnabled()) {
absoluteLocation = ResourcePatternUtils.isUrl(location) || ResourceUtils.toURI(location).isAbsolute();