X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fspring%2FSpringUtils.java;h=798b5648e28e1f35bfe6433866f17f0ba8384e3a;hb=c95d1a745fc431cdf7455a0e679516d537593a21;hp=7e01f3235840dffe9093e027c69e4a6fe86cdc35;hpb=326115a7da254a9f511a98e476059a26fda4efd2;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.core/src/main/java/org/argeo/slc/spring/SpringUtils.java b/org.argeo.slc.core/src/main/java/org/argeo/slc/spring/SpringUtils.java index 7e01f3235..798b5648e 100644 --- a/org.argeo.slc.core/src/main/java/org/argeo/slc/spring/SpringUtils.java +++ b/org.argeo.slc.core/src/main/java/org/argeo/slc/spring/SpringUtils.java @@ -2,13 +2,11 @@ package org.argeo.slc.spring; import java.io.IOException; import java.net.URI; -import java.net.URL; import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.argeo.slc.core.SlcException; -import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.BeanFactoryUtils; import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.core.io.DefaultResourceLoader; @@ -57,9 +55,9 @@ public class SpringUtils { public static String extractRelativePath(Resource ancestor, Resource child) { try { - return ancestor.getURI().relativize(child.getURI()).normalize() - .toString(); - } catch (IOException e) { + return ancestor.getURL().toURI().relativize(child.getURL().toURI()) + .normalize().toString(); + } catch (Exception e) { throw new SlcException("Cannot extract relative path of " + child + " based on " + ancestor, e); }