Solo se me ocurre esto tal como me has dicho, pero me da una excepción y no encuentro como solucionarla.
Citar
public int compRespUrl(String direcUrl) throws IOException {
try{
URL url = new URL(direcUrl);
int espera=3000;
int responseCode = (((HttpURLConnection) url.openConnection()).setConnectTimeout(espera)).getResponseCode();
return responseCode;
}catch(Exception e){
return 0;
}
}
try{
URL url = new URL(direcUrl);
int espera=3000;
int responseCode = (((HttpURLConnection) url.openConnection()).setConnectTimeout(espera)).getResponseCode();
return responseCode;
}catch(Exception e){
return 0;
}
}