Skip to content

Commit

Permalink
fix wrong default fed conf file, throw exception if conf file cannot …
Browse files Browse the repository at this point in the history
…be found
  • Loading branch information
keski committed Sep 24, 2024
1 parent b671a16 commit d442591
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
import java.util.Iterator;
import java.util.List;

import org.apache.jena.atlas.web.TypedInputStream;
import org.apache.jena.query.Query;
import org.apache.jena.query.QueryFactory;
import org.apache.jena.riot.system.stream.StreamManager;
import org.apache.jena.sparql.resultset.ResultsFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -48,9 +50,20 @@ public void init( ServletConfig config ) throws ServletException {
logger.info( "hefquin.configuration: " + configurationFile );
logger.info( "hefquin.federation: " + federationFile );

check( configurationFile );
check( federationFile );

// Initialize engine
engine = HeFQUINServerUtils.getEngine( federationFile, configurationFile );
logger.info( "Engine initialized" );
logger.info( "Engine initilized" );
}

public void check( String filenameOrURI ) {
TypedInputStream in = StreamManager.get().open(filenameOrURI);
if ( in == null ) {
throw new RuntimeException( "File not found: " + filenameOrURI );
}
in.close();
}

@Override
Expand Down

0 comments on commit d442591

Please sign in to comment.