Package facebook4j.conf

Examples of facebook4j.conf.ConfigurationBuilder.build()


        }
        if (videoBaseURL != null) {
            builder.setVideoBaseURL(videoBaseURL);
        }

        return builder.build();
    }

    /**
     * Returns {@link Facebook} instance. If needed, creates one from configuration.
     * @return {@link Facebook} instance
View Full Code Here


        String oAuthAppId = p.getProperty("oauth.appId");
        String oAuthAppSecret = p.getProperty("oauth.appSecret");
        build.setOAuthAccessToken(oAuthAccessToken);
        build.setOAuthAppId(oAuthAppId);
        build.setOAuthAppSecret(oAuthAppSecret);
        OAuthAuthorization auth = new OAuthAuthorization(build.build());
        Facebook fb = new FacebookFactory().getInstance(auth);
        fb.getId();
    }

    @Category(RealAPITests.class)
View Full Code Here

        String appSecret = p.getProperty("oauth.appSecret");

        ConfigurationBuilder build = new ConfigurationBuilder();
        build.setOAuthAppId(appId);
        build.setOAuthAppSecret(appSecret);
        Configuration configuration = build.build();
        HttpClientWrapper http = new HttpClientWrapper(configuration);
        HttpResponse res = http.get(configuration.getOAuthAccessTokenURL() +
                "?client_id=" + appId +
                "&client_secret=" + appSecret +
                "&grant_type=client_credentials");
View Full Code Here

            RequestMethod method = RequestMethod.GET;
            String url = "https://graph.facebook.com/foo/bar";
            HttpParameter[] parameters = new HttpParameter[1];
            parameters[0] = new HttpParameter("hoge", "1");
            ConfigurationBuilder cb = new ConfigurationBuilder().setOAuthAccessToken("access_token");
            OAuthAuthorization authorization = new OAuthAuthorization(cb.build());
            Map<String, String> requestHeaders = new HashMap<String, String>();

            HttpRequest actual = new HttpRequest(method, url, parameters, authorization, requestHeaders);
            assertThat(new URL(actual.getURL()), is(pathOf("/foo/bar")));
            assertThat(new URL(actual.getURL()), hasParameter("access_token", "access_token"));
View Full Code Here

            RequestMethod method = RequestMethod.POST;
            String url = "https://graph.facebook.com/foo/bar";
            HttpParameter[] parameters = new HttpParameter[1];
            parameters[0] = new HttpParameter("hoge", "1");
            ConfigurationBuilder cb = new ConfigurationBuilder().setOAuthAccessToken("access_token");
            OAuthAuthorization authorization = new OAuthAuthorization(cb.build());
            Map<String, String> requestHeaders = new HashMap<String, String>();

            HttpRequest actual = new HttpRequest(method, url, parameters, authorization, requestHeaders);
            assertThat(actual.getURL(), is("https://graph.facebook.com/foo/bar"));
            assertThat(actual.getParameters().length, is(2));
View Full Code Here

            parameters[0] = new HttpParameter("hoge", "1");
            ConfigurationBuilder cb = new ConfigurationBuilder()
                                        .setAppSecretProofEnabled(true)
                                        .setOAuthAppSecret("1234567890123456")
                                        .setOAuthAccessToken("access_token");
            OAuthAuthorization authorization = new OAuthAuthorization(cb.build());
            Map<String, String> requestHeaders = new HashMap<String, String>();

            HttpRequest actual = new HttpRequest(method, url, parameters, authorization, requestHeaders);
            assertThat(new URL(actual.getURL()), is(pathOf("/foo/bar")));
            assertThat(new URL(actual.getURL()), hasParameter("access_token", "access_token"));
View Full Code Here

            parameters[0] = new HttpParameter("hoge", "1");
            ConfigurationBuilder cb = new ConfigurationBuilder()
                                        .setAppSecretProofEnabled(true)
                                        .setOAuthAppSecret("1234567890123456")
                                        .setOAuthAccessToken("access_token");
            OAuthAuthorization authorization = new OAuthAuthorization(cb.build());
            Map<String, String> requestHeaders = new HashMap<String, String>();

            HttpRequest actual = new HttpRequest(method, url, parameters, authorization, requestHeaders);
            assertThat(actual.getURL(), is("https://graph.facebook.com/foo/bar"));
            assertThat(actual.getParameters().length, is(3));
View Full Code Here

    protected Facebook createFacebook() {
        ConfigurationBuilder cb = new ConfigurationBuilder();
        cb.setOAuthAppId(p.getProperty("oauth.appId")).setOAuthAppSecret(p.getProperty("oauth.appSecret"));
        cb.setOAuthAccessToken(p.getProperty("oauth.accessToken"));
        Authorization auth = new OAuthAuthorization(cb.build());
        return new FacebookFactory().getInstance(auth);
    }

    protected Calendar createCal(int year, int month, int day, int hour, int minute, int second, TimeZone tz) {
        Calendar cal = Calendar.getInstance(tz);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.