org.springframework.boot.web.server

Class Compression

  • java.lang.Object
    • org.springframework.boot.web.server.Compression


  • public class Compression
    extends java.lang.Object
    Simple server-independent abstraction for compression configuration.
    Since:
    2.0.0
    • Constructor Summary

      Constructors 
      Constructor and Description
      Compression() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean getEnabled()
      Return whether response compression is enabled.
      java.lang.String[] getExcludedUserAgents() 
      java.lang.String[] getMimeTypes()
      Return the MIME types that should be compressed.
      org.springframework.util.unit.DataSize getMinResponseSize()
      Return the minimum "Content-Length" value that is required for compression to be performed.
      void setEnabled(boolean enabled) 
      void setExcludedUserAgents(java.lang.String[] excludedUserAgents) 
      void setMimeTypes(java.lang.String[] mimeTypes) 
      void setMinResponseSize(org.springframework.util.unit.DataSize minSize) 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Compression

        public Compression()
    • Method Detail

      • getEnabled

        public boolean getEnabled()
        Return whether response compression is enabled.
        Returns:
        true if response compression is enabled
      • setEnabled

        public void setEnabled(boolean enabled)
      • getMimeTypes

        public java.lang.String[] getMimeTypes()
        Return the MIME types that should be compressed.
        Returns:
        the MIME types that should be compressed
      • setMimeTypes

        public void setMimeTypes(java.lang.String[] mimeTypes)
      • getExcludedUserAgents

        public java.lang.String[] getExcludedUserAgents()
      • setExcludedUserAgents

        public void setExcludedUserAgents(java.lang.String[] excludedUserAgents)
      • getMinResponseSize

        public org.springframework.util.unit.DataSize getMinResponseSize()
        Return the minimum "Content-Length" value that is required for compression to be performed.
        Returns:
        the minimum content size in bytes that is required for compression
      • setMinResponseSize

        public void setMinResponseSize(org.springframework.util.unit.DataSize minSize)