File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
rdf-processing-toolkit-cli/src/main/java/org/aksw/sparql_integrate/cli/main Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 3
3
import java .awt .Desktop ;
4
4
import java .io .IOException ;
5
5
import java .io .OutputStream ;
6
+ import java .net .DatagramSocket ;
7
+ import java .net .InetAddress ;
6
8
import java .net .URI ;
7
9
import java .nio .file .Files ;
8
10
import java .nio .file .Path ;
@@ -844,15 +846,20 @@ public void afterExec() {
844
846
845
847
server .start ();
846
848
847
- URI browseUri = new URI ("http://localhost:" + port + "/sparql" );
849
+ String hostAddress ;
850
+ try (final DatagramSocket socket = new DatagramSocket ()){
851
+ socket .connect (InetAddress .getByName ("1.1.1.1" ), 53 );
852
+ hostAddress = socket .getLocalAddress ().getHostAddress ();
853
+ }
854
+ URI browseUri = new URI ("http://" +hostAddress +":" + port + "/" );
848
855
if (Desktop .isDesktopSupported ()) {
849
856
try {
850
- Desktop .getDesktop ().browse (browseUri );
857
+ Desktop .getDesktop ().browse (new URI ( "http://localhost:" + port ) );
851
858
} catch (UnsupportedOperationException e ) {
852
859
logger .info ("Note: Could not open system browser." );
853
860
}
854
861
}
855
- logger .info ("SPARQL service running at: " + browseUri );
862
+ logger .info ("SPARQL service running at: " + browseUri + "sparql" );
856
863
}
857
864
858
865
try (RDFConnection conn = finalDataSource .getConnection ()) {
You can’t perform that action at this time.
0 commit comments