Skip to content

Commit

Permalink
Removing redundant slashes for URIs that are obtained from Class.getR…
Browse files Browse the repository at this point in the history
…esource()
  • Loading branch information
blackears committed Jul 22, 2021
1 parent 57f932f commit d4ca84c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion svg-core/src/main/java/com/kitfox/svg/SVGUniverse.java
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,16 @@ public SVGElement getElement(URI path, boolean loadIfAbsent)
{
try
{
String schemeSpecific = path.getSchemeSpecificPart();
if (schemeSpecific.startsWith("file:///"))
{
//Work around for URIs of resources obtained by Class.getResource()
schemeSpecific = "file:/" + schemeSpecific.substring(8);
}


//Strip fragment from URI
URI xmlBase = new URI(path.getScheme(), path.getSchemeSpecificPart(), null);
URI xmlBase = new URI(path.getScheme(), schemeSpecific, null);

SVGDiagram dia = (SVGDiagram) loadedDocs.get(xmlBase);
if (dia == null && loadIfAbsent)
Expand Down

0 comments on commit d4ca84c

Please sign in to comment.