0

I need a solution for testing the availability of http and https servers. For example: I need to know if servers (apache and tomcat) are available or not.

I don't need to consume inputstream, just display a green button if it works or red if it doesn't.

Alex Salauyou
  • 13,188
  • 4
  • 39
  • 67

1 Answers1

1

You can use URLConnection to check that your server is up. More about it:

Using java.net.URLConnection to fire and handle HTTP requests

Or HttpsUrlConnection:

http://www.mkyong.com/java/java-https-client-httpsurlconnection-example/

If connection return 200, then server is working.

Community
  • 1
  • 1
Vartlok
  • 2,309
  • 3
  • 25
  • 44