ProfileUtil.java 1.22 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.day.cq.personalization.ProfileUtil
 *  com.day.cq.security.profile.Profile
 *  javax.jcr.RepositoryException
 *  javax.jcr.Session
 *  org.apache.sling.api.SlingHttpServletRequest
 */
package com.day.cq.wcm.foundation.profile;

import com.day.cq.security.profile.Profile;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import org.apache.sling.api.SlingHttpServletRequest;

public class ProfileUtil {
    public static Profile fromRequest(SlingHttpServletRequest request) {
        return (Profile)request.adaptTo(Profile.class);
    }

    @Deprecated
    public static Profile getProfile(String userId, Session session) throws RepositoryException {
        throw new UnsupportedOperationException("getProfile() no longer supported. Retrieve via ProfileManager instead.");
    }

    @Deprecated
    public static boolean isAnonymous(Profile profile) {
        return com.day.cq.personalization.ProfileUtil.isAnonymous((Profile)profile);
    }

    @Deprecated
    public static boolean isAnonymous(SlingHttpServletRequest request) {
        return com.day.cq.personalization.ProfileUtil.isAnonymous((SlingHttpServletRequest)request);
    }
}