This commit is contained in:
Arjen Poutsma
2008-12-17 11:06:05 +00:00
parent 0050fbfbec
commit 3dfe569726
2 changed files with 6 additions and 3 deletions

View File

@@ -17,6 +17,7 @@
package org.springframework.xml.sax;
import java.io.IOException;
import java.net.URISyntaxException;
import org.xml.sax.InputSource;
@@ -49,11 +50,14 @@ public abstract class SaxUtils {
/** Retrieves the URL from the given resource as System ID. Returns <code>null</code> if it cannot be openened. */
public static String getSystemId(Resource resource) {
try {
return resource.getURI().toString();
return resource.getURL().toURI().toString();
}
catch (IOException e) {
return null;
}
catch (URISyntaxException e) {
return null;
}
}
}