Is it possible to run this cmd line command curl ipinfo.io within java?
I want to then pull the lat and long or "loc" from it afterwards. Thanks
You can use
var p = Runtime.getRuntime().exec("curl ipinfo.io") And read the output like:
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(p.getInputStream()))) { return bufferedReader.lines().collect(Collectors.toList()); } catch (IOException e) { e.printStackTrace() }