|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2019 the original author or authors. |
|
|
|
* Copyright 2002-2021 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. |
|
|
|
@ -20,6 +20,7 @@ import java.io.File; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.net.URL; |
|
|
|
import java.net.URL; |
|
|
|
import java.net.URLDecoder; |
|
|
|
import java.net.URLDecoder; |
|
|
|
|
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.logging.Log; |
|
|
|
import org.apache.commons.logging.Log; |
|
|
|
import org.apache.commons.logging.LogFactory; |
|
|
|
import org.apache.commons.logging.LogFactory; |
|
|
|
@ -80,7 +81,7 @@ public class ResourceEntityResolver extends DelegatingEntityResolver { |
|
|
|
if (source == null && systemId != null) { |
|
|
|
if (source == null && systemId != null) { |
|
|
|
String resourcePath = null; |
|
|
|
String resourcePath = null; |
|
|
|
try { |
|
|
|
try { |
|
|
|
String decodedSystemId = URLDecoder.decode(systemId, "UTF-8"); |
|
|
|
String decodedSystemId = URLDecoder.decode(systemId, StandardCharsets.UTF_8); |
|
|
|
String givenUrl = new URL(decodedSystemId).toString(); |
|
|
|
String givenUrl = new URL(decodedSystemId).toString(); |
|
|
|
String systemRootUrl = new File("").toURI().toURL().toString(); |
|
|
|
String systemRootUrl = new File("").toURI().toURL().toString(); |
|
|
|
// Try relative to resource base if currently in system root.
|
|
|
|
// Try relative to resource base if currently in system root.
|
|
|
|
|