HttpClient를 이용해서 해당 url을 호출한뒤 상태를 확인해보는 sample입니다.
이것을 가지고 해당 url이 오류여부 확인 가능하다.

 public void test_001 () {
//  String rssurl = "
http://crizin.net/rss";
  String rssurl = "
http://neouser.tistory.com/rss";
  HttpClient client = new HttpClient();
  GetMethod getMethod = new GetMethod(rssurl);

  try {
   int status = client.executeMethod(getMethod);  
   String message = getMethod.getStatusText();
   
System.out.println("status : "+status);  
System.out.println("001 : "+getMethod.getResponseBodyAsString());  
System.out.println("002 : "+getMethod.getStatusLine());  
System.out.println("003 : "+getMethod.getName());
System.out.println("003 : "+getMethod.getResponseHeader("Location"));
//System.out.println(new String (request));  
  } catch (HttpException e) {
   e.printStackTrace();
  } catch (IOException e) {
   e.printStackTrace();
  }
 
 }


글 보관함

카운터

Total : / Today : / Yesterday :
get rsstistory!