All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.threerings.facebook.servlet.FacebookConfig Maven / Gradle / Ivy

The newest version!
//
// $Id$

package com.threerings.facebook.servlet;

import javax.servlet.http.HttpServletRequest;

import com.threerings.app.server.ServletAuthUtil;

/**
 * Provides Facebook configuration information to things that need it.
 */
public abstract class FacebookConfig
{
    /**
     * Returns our Facebook API key.
     */
    public abstract String getFacebookKey ();

    /**
     * Returns our Facebook app secret.
     */
    public abstract String getFacebookSecret ();

    /**
     * Returns our Facebook app id.
     */
    public abstract String getFacebookAppId ();

    /**
     * Returns our Facebook app name.
     */
    public abstract String getFacebookAppName ();

    /**
     * Returns the bare URL to our Facebook app.
     */
    public String getFacebookAppURL (HttpServletRequest req) {
        return getFacebookAppURL(ServletAuthUtil.getScheme(req));
    }

    /**
     * Returns the bare URL to our Facebook app.
     */
    public String getFacebookAppURL (String scheme) {
        String appname = getFacebookAppName();
        String apppath = (appname != null ? appname : "missing_appname");
        return scheme +"://apps.facebook.com/" + apppath + "/";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy