Package facebook4j.internal.http

Examples of facebook4j.internal.http.HttpResponse


    public boolean installTab(String appId) throws FacebookException {
        return installTab("me", appId);
    }
    public boolean installTab(String pageId, String appId) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = post(buildEndpoint(pageId, "tabs"), new HttpParameter[]{new HttpParameter("app_id", appId)});
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here


    public boolean updateTab(String tabId, TabUpdate tabUpdate) throws FacebookException {
        return updateTab("me", tabId, tabUpdate);
    }
    public boolean updateTab(String pageId, String tabId, TabUpdate tabUpdate) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = post(buildEndpoint(pageId, "tabs/" + tabId), tabUpdate.asHttpParameterArray());
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

    public boolean deleteTab(String tabId) throws FacebookException {
        return deleteTab("me", tabId);
    }
    public boolean deleteTab(String pageId, String tabId) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = delete(buildEndpoint(pageId, "tabs/" + tabId));
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

        return Boolean.valueOf(res.asString().trim());
    }

    public boolean displayPagePost(String postId, boolean isHidden) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = post(buildEndpoint(postId), new HttpParameter[]{new HttpParameter("is_hidden", isHidden)});
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

        return block("me", userIds);
    }
    public Map<String, Boolean> block(String pageId, List<String> userIds) throws FacebookException {
        ensureAuthorizationEnabled();
        String _userIds = z_F4JInternalStringUtil.join(userIds.toArray(new String[userIds.size()]), ",");
        HttpResponse res = post(buildEndpoint(pageId, "blocked"), new HttpParameter[]{new HttpParameter("uid", _userIds)});
        Map<String, Boolean> blocks = new HashMap<String, Boolean>();
        JSONObject jsonObject = res.asJSONObject();
        Iterator<String> uids = jsonObject.keys();
        while (uids.hasNext()) {
            String uid = uids.next();
            boolean result = getBoolean(uid, jsonObject);
            blocks.put(uid, result);
View Full Code Here

    public boolean unblock(String userId) throws FacebookException {
        return unblock("me", userId);
    }
    public boolean unblock(String pageId, String userId) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = delete(buildEndpoint(pageId, "blocked"), new HttpParameter[]{new HttpParameter("uid", userId)});
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

        return getRawString("id", json);
    }

    public boolean deleteOffer(String offerId) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = delete(buildEndpoint(offerId));
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

    public Page getLikedPage(String userId, String pageId) throws FacebookException {
        return getLikedPage(userId, pageId, null);
    }
    public Page getLikedPage(String userId, String pageId, Reading reading) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = get(buildEndpoint(userId, "likes/" + pageId, reading));
        ResponseList<Page> list = factory.createPageList(res);
        return list.size() == 0 ? null : list.get(0);
    }
View Full Code Here

    public boolean revokePermission(String permissionName) throws FacebookException {
        return revokePermission("me", permissionName);
    }
    public boolean revokePermission(String userId, String permissionName) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = delete(buildEndpoint(userId, "permissions/" + permissionName));
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

        return _unlike(photoId);
    }

    public URL getPhotoURL(String photoId) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = get(buildEndpoint(photoId, "picture"));
        try {
            return new URL(res.getResponseHeader("Location"));
        } catch (MalformedURLException urle) {
            throw new FacebookException(urle.getMessage(), urle);
        }
    }
View Full Code Here

TOP

Related Classes of facebook4j.internal.http.HttpResponse

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.