Skip to content

Commit 0f7fbd0

Browse files
committed
Merge branch 'develop' of github.com:SmartDataAnalytics/SparqlIntegrate into develop
2 parents 468890b + 33506e0 commit 0f7fbd0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

rdf-processing-toolkit-cli/src/main/java/org/aksw/sparql_integrate/cli/main/SparqlIntegrateCmdImpls.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import java.awt.Desktop;
44
import java.io.IOException;
55
import java.io.OutputStream;
6+
import java.net.DatagramSocket;
7+
import java.net.InetAddress;
68
import java.net.URI;
79
import java.nio.file.Files;
810
import java.nio.file.Path;
@@ -844,15 +846,20 @@ public void afterExec() {
844846

845847
server.start();
846848

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 + "/");
848855
if (Desktop.isDesktopSupported()) {
849856
try {
850-
Desktop.getDesktop().browse(browseUri);
857+
Desktop.getDesktop().browse(new URI("http://localhost:"+port));
851858
} catch (UnsupportedOperationException e) {
852859
logger.info("Note: Could not open system browser.");
853860
}
854861
}
855-
logger.info("SPARQL service running at: " + browseUri);
862+
logger.info("SPARQL service running at: " + browseUri + "sparql");
856863
}
857864

858865
try (RDFConnection conn = finalDataSource.getConnection()) {

0 commit comments

Comments
 (0)