org.apache.hadoop.fs.http.server

## Class CheckUploadContentTypeFilter

- java.lang.Object
- - org.apache.hadoop.fs.http.server.CheckUploadContentTypeFilter

- All Implemented Interfaces:
    javax.servlet.Filter

      @InterfaceAudience.Private
      public class CheckUploadContentTypeFilter
      extends Object
      implements javax.servlet.Filter

  Filter that Enforces the content-type to be application/octet-stream for POST and PUT requests.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CheckUploadContentTypeFilter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` Destroys the filter.
    `void` | `doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)` Enforces the content-type to be application/octet-stream for POST and PUT requests.
    `void` | `init(javax.servlet.FilterConfig config)` Initializes the filter.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CheckUploadContentTypeFilter

          public CheckUploadContentTypeFilter()

  - ### Method Detail

    - #### init

          public void init(javax.servlet.FilterConfig config)
                    throws javax.servlet.ServletException

      Initializes the filter.

      This implementation is a NOP.

      Specified by:
        `init` in interface `javax.servlet.Filter`
      Parameters:
        `config` - filter configuration.
      Throws:
        `javax.servlet.ServletException` - thrown if the filter could not be initialized.

    - #### doFilter

          public void doFilter(javax.servlet.ServletRequest request,
                               javax.servlet.ServletResponse response,
                               javax.servlet.FilterChain chain)
                        throws IOException,
                               javax.servlet.ServletException

      Enforces the content-type to be application/octet-stream for POST and PUT requests.
      Specified by:
        `doFilter` in interface `javax.servlet.Filter`
      Parameters:
        `request` - servlet request.
        `response` - servlet response.
        `chain` - filter chain.
      Throws:
        `IOException` - thrown if an IO error occurs.
        `javax.servlet.ServletException` - thrown if a servlet error occurs.

    - #### destroy

          public void destroy()

      Destroys the filter.

      This implementation is a NOP.

      Specified by:
        `destroy` in interface `javax.servlet.Filter`

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.