Android Open Source - EdXVideoViewer Unexpected Http Response Exception






From Project

Back to project page EdXVideoViewer.

License

The source code is released under:

MIT License

If you think the Android project EdXVideoViewer 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.github.krooken.edxvideoviewer;
/*w  ww  .  j  av a 2s. com*/
import org.apache.http.Header;

public class UnexpectedHttpResponseException extends RuntimeException {

  /**
   * 
   */
  private static final long serialVersionUID = 1L;
  private String requestUrl;
  private Header[] responseHeaders;
  private String httpResponse;

  public UnexpectedHttpResponseException() {
    super();
  }

  public UnexpectedHttpResponseException(String detailMessage) {
    super(detailMessage);
  }

  public UnexpectedHttpResponseException(Throwable throwable) {
    super(throwable);
  }

  public UnexpectedHttpResponseException(String detailMessage, Throwable throwable) {
    super(detailMessage, throwable);
  }
  
  public void setRequestUrl(String url) {
    requestUrl = url;
  }
  
  public void setResponseHeader(Header[] headers) {
    responseHeaders = headers;
  }
  
  public void setHttpResponse(String response) {
    httpResponse = response;
  }
  
  public String getRequestUrl() {
    if (requestUrl != null) {
      return requestUrl;
    }else {
      return "null";
    }
  }
  
  public String getFormattedHeaders() {
    String ret = "";
    if(responseHeaders != null) {
      for(int i=0; i<responseHeaders.length; i++) {
        ret += responseHeaders[i].getName();
        ret += ": ";
        ret += responseHeaders[i].getValue();
        ret += "\n";
      }
      return ret;
    }else {
      return "null";
    }
  }
  
  public String getResponse() {
    if(httpResponse != null) {
      return httpResponse;
    }else {
      return "null";
    }
  }

}




Java Source Code List

com.github.krooken.edxvideoviewer.CourseViewer.java
com.github.krooken.edxvideoviewer.CoursewareContentViewer.java
com.github.krooken.edxvideoviewer.CoursewareSectionViewer.java
com.github.krooken.edxvideoviewer.HttpGetRequest.java
com.github.krooken.edxvideoviewer.LoginScreen.java
com.github.krooken.edxvideoviewer.UncaughtExceptionLogger.java
com.github.krooken.edxvideoviewer.UnexpectedHttpResponseException.java