ClassPathResource uses specific constructors in createRelative
Issue: SPR-16146
(cherry picked from commit d00e4f1)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -197,7 +197,8 @@ public class ClassPathResource extends AbstractFileResolvingResource {
|
||||
@Override
|
||||
public Resource createRelative(String relativePath) {
|
||||
String pathToUse = StringUtils.applyRelativePath(this.path, relativePath);
|
||||
return new ClassPathResource(pathToUse, this.classLoader, this.clazz);
|
||||
return (this.clazz != null ? new ClassPathResource(pathToUse, this.clazz) :
|
||||
new ClassPathResource(pathToUse, this.classLoader));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user