FileUrlResource creates same class from createRelative
Issue: SPR-16140
This commit is contained in:
parent
a75dd2dd3e
commit
07b479e264
|
@ -70,6 +70,14 @@ public class FileUrlResource extends UrlResource implements WritableResource {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Resource createRelative(String relativePath) throws MalformedURLException {
|
||||
if (relativePath.startsWith("/")) {
|
||||
relativePath = relativePath.substring(1);
|
||||
}
|
||||
return new FileUrlResource(new URL(getURL(), relativePath));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWritable() {
|
||||
try {
|
||||
|
|
|
@ -183,7 +183,7 @@ public class UrlResource extends AbstractFileResolvingResource {
|
|||
* This implementation returns the underlying URL reference.
|
||||
*/
|
||||
@Override
|
||||
public URL getURL() throws IOException {
|
||||
public URL getURL() {
|
||||
return this.url;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue