HeidelTime / heideltime

A multilingual, cross-domain temporal tagger developed at the Database Systems Research Group at Heidelberg University.
GNU General Public License v3.0
343 stars 67 forks source link

Fix escaping in path to rules resources #39

Closed Hronom closed 8 years ago

Hronom commented 8 years ago

Previously for this path:

C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\test#servlet\WEB-INF\lib\heideltime-2.1.jar

if we use:

this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath();

we get escaped path, like this:

C:\Program%20Files\Apache%20Software%20Foundation\Tomcat%208.0\webapps\test#servlet\WEB-INF\lib\heideltime-2.1.jar

so jarFile.isFile() returns false for this path.

I have changed this:

this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath();

to this:

this.getClass().getProtectionDomain().getCodeSource().getLocation().toURI().getPath();

this one returns proper path.

JannikStroetgen commented 8 years ago

Thanks a lot for your pull request and sorry for the late reply. We will publish a new HeidelTime version within the next two weeks and I will include this fix.