1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

change VrpXmlReader such that resources in jar-format can be located

This commit is contained in:
Stefan Schroeder 2013-06-06 09:31:31 +02:00
parent 2e2bb8d443
commit a28357417c

View file

@ -21,7 +21,7 @@
package basics.io;
import java.io.IOException;
import java.net.URL;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@ -98,14 +98,14 @@ public class VrpXMLReader{
xmlConfig.setDelimiterParsingDisabled(true);
if(schemaValidation){
final URL resource = Resource.getAsURL("vrp_xml_schema.xsd");
final InputStream resource = Resource.getAsInputStream("vrp_xml_schema.xsd");
if(resource != null) {
EntityResolver resolver = new EntityResolver() {
@Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
{
InputSource is = new InputSource(resource.getFile());
InputSource is = new InputSource(resource);
return is;
}
}