Class CrossOriginResourceSharing

java.lang.Object
ecmwf.ecpds.mover.plugin.http.CrossOriginResourceSharing

public final class CrossOriginResourceSharing extends Object
The Class CrossOriginResourceSharing.
Author:
root
  • Field Details

    • SUPPORTED_METHODS

      protected static final Collection<String> SUPPORTED_METHODS
      The Constant SUPPORTED_METHODS.
  • Constructor Details

    • CrossOriginResourceSharing

      public CrossOriginResourceSharing()
      Instantiates a new cross origin resource sharing.
    • CrossOriginResourceSharing

      public CrossOriginResourceSharing(Collection<String> allowedOrigins, Collection<String> allowedMethods, Collection<String> allowedHeaders)
      Instantiates a new cross origin resource sharing.
      Parameters:
      allowedOrigins - the allowed origins
      allowedMethods - the allowed methods
      allowedHeaders - the allowed headers
  • Method Details

    • getAllowedMethods

      public String getAllowedMethods()
      Gets the allowed methods.
      Returns:
      the allowed methods
    • getAllowedOrigin

      public String getAllowedOrigin(String origin)
      Gets the allowed origin.
      Parameters:
      origin - the origin
      Returns:
      the allowed origin
    • isOriginAllowed

      public boolean isOriginAllowed(String origin)
      Checks if is origin allowed.
      Parameters:
      origin - the origin
      Returns:
      true, if is origin allowed
    • isMethodAllowed

      public boolean isMethodAllowed(String method)
      Checks if is method allowed.
      Parameters:
      method - the method
      Returns:
      true, if is method allowed
    • isEveryHeaderAllowed

      public boolean isEveryHeaderAllowed(String headers)
      Checks if is every header allowed.
      Parameters:
      headers - the headers
      Returns:
      true, if is every header allowed
    • equals

      public boolean equals(Object object)
      Equals.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Hash code.
      Overrides:
      hashCode in class Object