Package com.tumblr.jumblr.exceptions

Examples of com.tumblr.jumblr.exceptions.JumblrException


        Response response = request.send();
        HttpURLConnection.setFollowRedirects(presetVal);
        if (response.getCode() == 301) {
            return response.getHeader("Location");
        } else {
            throw new JumblrException(response);
        }
    }
View Full Code Here


                Gson gson = new GsonBuilder().
                        registerTypeAdapter(JsonElement.class, new JsonElementDeserializer()).
                        create();
                ResponseWrapper wrapper = gson.fromJson(json, ResponseWrapper.class);
                if (wrapper == null) {
                    throw new JumblrException(response);
                }
                wrapper.setClient(client);
                return wrapper;
            } catch (JsonSyntaxException ex) {
                throw new JumblrException(response);
            }
        } else {
            throw new JumblrException(response);
        }
    }
View Full Code Here

            if (extractedToken != null && extractedSecret != null) {
                return new Token(extractedToken, extractedSecret);
            }
        }
        // No good
        throw new JumblrException(response);
    }
View Full Code Here

    /* package-visible for testing */ Token clearXAuth(Response response) {
        if (response.getCode() == 200 || response.getCode() == 201) {
            return parseXAuthResponse(response);
        } else {
            throw new JumblrException(response);
        }
    }
View Full Code Here

TOP

Related Classes of com.tumblr.jumblr.exceptions.JumblrException

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.