org.rhq.plugins.www.util
Class WWWUtils
java.lang.Object
org.rhq.plugins.www.util.WWWUtils
public abstract class WWWUtils
- extends Object
Helper class that contains methods that send http requests and evaluate results
- Author:
- Ian Springer
|
Method Summary |
static String |
getServerHeader(URL httpURL)
Get the content of the 'Server:' header |
static boolean |
isAvailable(URL httpURL)
Sends a HEAD request to the passed url and returns if the server was reachable |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WWWUtils
public WWWUtils()
isAvailable
public static boolean isAvailable(URL httpURL)
- Sends a HEAD request to the passed url and returns if the server was reachable
- Parameters:
httpURL - a http or https URL to check
- Returns:
- true if connecting to the URL succeeds, or false otherwise
getServerHeader
public static String getServerHeader(URL httpURL)
- Get the content of the 'Server:' header
- Parameters:
httpURL - a http or https URL to get the header from
- Returns:
- The contents of the header or null if anything went wrong or the field was not present.
Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.