From 2b0d7ce058b90fe55fca99c68cd2aa4757088858 Mon Sep 17 00:00:00 2001 From: dschiese Date: Thu, 11 Apr 2024 13:41:18 +0200 Subject: [PATCH] Refactored code to use env variable --- .../repositories/AbstractRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/wse/qanaryexplanationservice/repositories/AbstractRepository.java b/src/main/java/com/wse/qanaryexplanationservice/repositories/AbstractRepository.java index cdad10c..c5046e2 100644 --- a/src/main/java/com/wse/qanaryexplanationservice/repositories/AbstractRepository.java +++ b/src/main/java/com/wse/qanaryexplanationservice/repositories/AbstractRepository.java @@ -7,6 +7,7 @@ import org.apache.jena.query.ResultSet; import org.apache.jena.rdfconnection.RDFConnection; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.core.env.Environment; import org.springframework.http.MediaType; import org.springframework.stereotype.Repository; @@ -30,11 +31,10 @@ public abstract class AbstractRepository implements SparqlRepositoryIF { protected Environment environment; protected RDFConnection rdfConnection; - @Autowired protected AbstractRepository(Environment environment) throws MalformedURLException { this.environment = environment; - this.sparqlEndpoint = new URL("http://localhost:8080/sparql"); + this.sparqlEndpoint = new URL(environment.getProperty("sparql.endpoint")); this.rdfConnection = RDFConnection.connect(sparqlEndpoint.toString()); }