|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2012 the original author or authors. |
|
|
|
* Copyright 2002-2014 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
@ -88,7 +88,10 @@ public class DefaultResourceLoader implements ResourceLoader { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Resource getResource(String location) { |
|
|
|
public Resource getResource(String location) { |
|
|
|
Assert.notNull(location, "Location must not be null"); |
|
|
|
Assert.notNull(location, "Location must not be null"); |
|
|
|
if (location.startsWith(CLASSPATH_URL_PREFIX)) { |
|
|
|
if (location.startsWith("/")) { |
|
|
|
|
|
|
|
return getResourceByPath(location); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (location.startsWith(CLASSPATH_URL_PREFIX)) { |
|
|
|
return new ClassPathResource(location.substring(CLASSPATH_URL_PREFIX.length()), getClassLoader()); |
|
|
|
return new ClassPathResource(location.substring(CLASSPATH_URL_PREFIX.length()), getClassLoader()); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|