Package ch.rolandschaer.ascrblr

Examples of ch.rolandschaer.ascrblr.HttpRequest$Factory


   
    InputStream resultStream = null;
   
    try {

      HttpRequest request = requestFactory.getRequest(RequestType.QUERY, new URL(feed.getUrl()))
     
      if(connectTimeout>0) {
        request.setConnectTimeout(connectTimeout);
      }
     
      if(readTimeout>0) {
        request.setReadTimeout(readTimeout);
      }

      // Execute the request
      request.execute();     
      resultStream = request.getResponseStream();
     
      feed.parse(resultStream);

      return feed;
     
View Full Code Here


    if(!isTunedIn) {
      throw new IllegalStateException("Method tuneInStation() has to be called first");
    }
   
    URL url = new URL(sessionToken.getStreamingUrl());
    HttpRequest request = requestFactory.getRequest(RequestType.STREAM, url)
   
    if(connectTimeout>0) {
      request.setConnectTimeout(connectTimeout);
    }
   
    if(readTimeout>0) {
      request.setReadTimeout(readTimeout);
    }

    // Execute the request
    request.execute();     
   
    // Handle response
    return  new BufferedInputStream(request.getResponseStream());
 
  }
View Full Code Here

                SERVICE_BASEURL +
                "radio/np.php" +
                "?session=" +sessionToken.getSessionId() +
                "&debug=0"
            );
            HttpRequest request = requestFactory.getRequest(RequestType.QUERY, url);
           
            if(connectTimeout>0) {
                request.setConnectTimeout(connectTimeout);
            }
           
            if(readTimeout>0) {
                request.setReadTimeout(readTimeout);
            }

            // Execute the request
            request.execute();         
           
            // Handle response
            resultStream = request.getResponseStream();
            HashMap<String,String> parameter = ResponseUtil.getParameterMap(resultStream);

            if( !parameter.containsKey("streaming")
                    || "false".equals(parameter.get("streaming")) ) {
                throw new IllegalStateException("Method getMp3Stream() has to be called first.");
View Full Code Here

TOP

Related Classes of ch.rolandschaer.ascrblr.HttpRequest$Factory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.