AuthHttpContext.java 1.29 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  javax.servlet.http.HttpServletRequest
 *  javax.servlet.http.HttpServletResponse
 *  org.apache.sling.auth.core.AuthenticationSupport
 *  org.osgi.service.http.HttpContext
 */
package com.day.crx.delite.impl;

import java.io.IOException;
import java.net.URL;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.sling.auth.core.AuthenticationSupport;
import org.osgi.service.http.HttpContext;

class AuthHttpContext
implements HttpContext {
    private AuthenticationSupport authenticator;

    AuthHttpContext() {
    }

    public void setAuthenticationSupport(AuthenticationSupport auth) {
        this.authenticator = auth;
    }

    public String getMimeType(String name) {
        return null;
    }

    public URL getResource(String name) {
        return null;
    }

    public boolean handleSecurity(HttpServletRequest request, HttpServletResponse response) throws IOException {
        AuthenticationSupport localAuthenticator = this.authenticator;
        if (localAuthenticator != null) {
            return localAuthenticator.handleSecurity(request, response);
        }
        response.sendError(503);
        response.flushBuffer();
        return false;
    }
}