본문 바로가기

Project 자료수집

IMDB XML 가져오기

String address = "http://www.omdbapi.com/?t=Iron%20Man%202&plot=full&r=XML&tomatoes=true";

 

StringBuffer content = new StringBuffer();

 

try {

URL url = new URL(address);

URLConnection connection = url.openConnection();

 

BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));

 

String line = null;

while ((line= in.readLine()) != null) {

content.append(line);

System.out.println(line);

}

in.close();

} catch (Exception e) {

content = new StringBuffer("error");

}

'Project 자료수집' 카테고리의 다른 글

SWT 레이아웃 정리  (0) 2013.09.23
[java.core] 간단한 String XML 파싱 예제  (0) 2013.09.23
API 및 RAP  (0) 2013.09.17
CEA-2014 관련 링크  (0) 2013.09.03
RCP에서 전체화면 혹은 최대화하기  (0) 2013.09.03