Android Open Source - WeatherBar Client Response






From Project

Back to project page WeatherBar.

License

The source code is released under:

MIT License

If you think the Android project WeatherBar listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.cjbarker.wb.ws;
//from   w  w w  .ja va  2s.  c  om
import org.apache.http.Header;

/**
 * Class holds HTTP response data affiliated w/ <code>ClientRequest.java</code> 
 * 
 * @author CJ Barker
 */
public class ClientResponse {
  
  protected final int respCode;      // HTTP response code
  protected final byte[] respMesssage;  // HTTP response msg
  protected final Header[] headers;    // HTTP response hdrs
  
  private ClientResponse() {
    this.respCode = 0;
    this.respMesssage = null;
    this.headers = null;
  }
  
  public ClientResponse(int code, byte[] msg, Header[] hdrs) {
    this.respCode = code;
    this.respMesssage = msg;
    this.headers = hdrs;
  }
  
  public String toString() {
      int bLen = (this.respMesssage != null) ? this.respMesssage.length : 0;
      return ("Response Code: "+this.respCode+"\nResponse Msg Byte Len: "+bLen);
    }

    /* getters */
    public final byte[] getResponseMessage() {
        return this.respMesssage;
    }
    public int getResponseCode() { 
        return this.respCode;
    }
    public final Header[] getHeaders() {
      return this.headers;
    }
}




Java Source Code List

com.cjbarker.wb.Main.java
com.cjbarker.wb.Notifier.java
com.cjbarker.wb.Prefs.java
com.cjbarker.wb.Util.java
com.cjbarker.wb.receiver.BatteryLevel.java
com.cjbarker.wb.receiver.Connection.java
com.cjbarker.wb.receiver.Screen.java
com.cjbarker.wb.ws.ClientRequestTest.java
com.cjbarker.wb.ws.ClientRequest.java
com.cjbarker.wb.ws.ClientResponse.java
com.cjbarker.wb.ws.OpenWeatherTest.java
com.cjbarker.wb.ws.OpenWeather.java
com.cjbarker.wb.ws.WeatherTest.java
com.cjbarker.wb.ws.Weather.java