Class HttpHeadersInitializer


  • public class HttpHeadersInitializer
    extends Object
    This class takes data from the Bitstream/File that has to be send. It'll then digest this input and save it in its local variables. When calling {initialiseHeaders()}, the input and information will be used to set the proper headers with this info and return an Object of HttpHeaders to be used in the response that'll be generated
    • Field Detail

      • log

        protected final org.slf4j.Logger log
    • Constructor Detail

      • HttpHeadersInitializer

        public HttpHeadersInitializer​(InputStream inputStream)
    • Method Detail

      • initialiseHeaders

        public org.springframework.http.HttpHeaders initialiseHeaders()
                                                               throws IOException
        This method will be called to create a HttpHeaders object which will contain the headers needed to form a proper response when returning the Bitstream/File
        Returns:
        A HttpHeaders object containing the information for the Bitstream/File to be sent
        Throws:
        IOException - If something goes wrong
      • isValid

        public boolean isValid()
                        throws IOException
        This method will validate whether or not the given Response/Request/Information/Variables are valid. If they're invalid, the Response shouldn't be given. This will do null checks on the response, request, inputstream and filename. Other than this, it'll check Request headers to see if their information is correct.
        Returns:
        Throws:
        IOException