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

restx.security.AcceptedCORS Maven / Gradle / Ivy

There is a newer version: 1.2.0-rc2
Show newest version
package restx.security;

import com.google.common.base.Optional;
import restx.RestxRequest;

import java.util.Collection;

/**
* User: xavierhanin
* Date: 4/1/13
* Time: 10:29 PM
*/
public class AcceptedCORS extends CORS {
    private final String origin;
    private final Collection methods;
    private final Collection headers;
    private final Optional credentials;
    private final int maxAge;

    AcceptedCORS(String origin, Collection methods, Collection headers, Optional credentials, int maxAge) {
        this.headers = headers;
        this.credentials = credentials;
        this.origin = origin;
        this.methods = methods;
        this.maxAge = maxAge;
    }


    public boolean isAccepted() {
        return true;
    }

    public String getOrigin() {
        return origin;
    }

    public Collection getMethods() {
        return methods;
    }

    public Collection getHeaders() {
        return headers;
    }

    public Optional getAllowCredentials() {
        return credentials;
    }

    public int getMaxAge() {
        return maxAge;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy