Example usage for java.net UnknownServiceException UnknownServiceException

List of usage examples for java.net UnknownServiceException UnknownServiceException

Introduction

In this page you can find the example usage for java.net UnknownServiceException UnknownServiceException.

Prototype

public UnknownServiceException() 

Source Link

Document

Constructs a new UnknownServiceException with no detail message.

Usage

From source file:kr.pe.javarss.mybus.task.GBusPageParser.java

public static InputStream getPageInputStream(String url) throws IOException {

    //    :   30   ?
    HttpParams params = new BasicHttpParams();
    HttpConnectionParams.setConnectionTimeout(params, CONNECTION_TIMEOUT);
    HttpConnectionParams.setSoTimeout(params, CONNECTION_TIMEOUT);

    HttpClient hc = new DefaultHttpClient(params);
    HttpResponse res = hc.execute(new HttpGet(url));
    if (res.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
        throw new UnknownServiceException();
    }/*from  w w w .java 2s.  c  o m*/

    return res.getEntity().getContent();
}