
com.threerings.facebook.FBParam Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ooo-facebook Show documentation
Show all versions of ooo-facebook Show documentation
Various Facebook helper bits used by OOO.
The newest version!
//
// $Id$
package com.threerings.facebook;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import com.samskivert.servlet.util.DataValidationException;
import com.samskivert.servlet.util.ParameterUtil;
public enum FBParam
{
INSTALL("fb_sig_authorize"),
UNINSTALL("fb_sig_uninstall"),
USER("fb_sig_user"),
PROFILE_UPDATE_TIME("fb_profile_update_time"),
EXPIRES("fb_sig_expires"),
ADDED("fb_sig_added"),
CANVAS_USER("fb_sig_canvas_user"),
TIME("fb_sig_time"),
SESSION_KEY("fb_sig_session_key"),
SESSION_KEY_COOKIE("fb_sig_session_key_cookie"),
APP_ID("fb_sig_app_id"),
API_KEY("fb_sig_api_key"),
LINKED_ACCOUNT_IDS("fb_sig_linked_account_ids"),
IDS("ids[]"),
SIG("fb_sig");
public int getIntValue (HttpServletRequest req)
throws DataValidationException
{
return ParameterUtil.getIntParameter(req, _fbName, -1,
_fbName + " parameter improperly formed.");
}
public long getLongValue (HttpServletRequest req)
throws DataValidationException
{
return ParameterUtil.getLongParameter(req, _fbName, -1,
_fbName + " parameter improperly formed.");
}
public String getStringValue (HttpServletRequest req)
{
return getStringValue(req, true);
}
public String getStringValue (HttpServletRequest req, boolean returnNull)
{
return ParameterUtil.getParameter(req, _fbName, returnNull);
}
public Set getStringSet (HttpServletRequest req)
{
return ParameterUtil.getParameters(req, _fbName);
}
public boolean getBooleanValue (HttpServletRequest req)
{
String value = ParameterUtil.getParameter(req, _fbName, true);
return "1".equals(value) || "true".equals(value);
}
public boolean isSet (HttpServletRequest req)
{
return ParameterUtil.isSet(req, _fbName);
}
private FBParam (String fbName) {
_fbName = fbName;
}
protected String _fbName;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy