Search in sources :

Example 1 with Articles

use of com.stylingandroid.designlibrary.rss.model.Articles in project DesignLibrary by StylingAndroid.

the class RssRequest method parseNetworkResponse.

@Override
protected Response<Articles> parseNetworkResponse(NetworkResponse response) {
    InputStream inputStream = new ByteArrayInputStream(response.data);
    SaRssParser parser = SaRssParser.newInstance(inputStream);
    Articles articles;
    try {
        articles = parser.parse();
    } catch (Exception e) {
        return Response.error(new ParseError(e));
    }
    return Response.success(articles, HttpHeaderParser.parseCacheHeaders(response));
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) Articles(com.stylingandroid.designlibrary.rss.model.Articles) ParseError(com.android.volley.ParseError)

Aggregations

ParseError (com.android.volley.ParseError)1 Articles (com.stylingandroid.designlibrary.rss.model.Articles)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1