* Performs HEAD request for the given URI.<BR>
* If any exception occurs <code>false</code> is returned. Otherwise true. <BR>
* @param serviceUri the URI to test.
- * @return true if service is available.
+ * @return true if service is available, false otherwise. Also a non-absolute URI will return false.
*/
public static boolean isServiceAvailable(URI serviceUri){
return isServiceAvailable(serviceUri, null);
* If any exception occurs <code>false</code> is returned. Otherwise true. <BR>
* @param serviceUri the URI to test.
* @param timeout the timeout of the request in milliseconds
- * @return true if service is available.
+ * @return true if service is available, false otherwise. Also a non-absolute URI will return false.
*/
public static boolean isServiceAvailable(URI serviceUri, Integer timeout){
boolean result = false;
- if(serviceUri==null || serviceUri.getHost()==null){
+ if(serviceUri==null || serviceUri.getHost()==null || !serviceUri.isAbsolute()){
return false;
}