Class WebServerDispatcher.Resource

    • Field Detail

      • GZIP_SUPPORT_DISABLED

        public static final int GZIP_SUPPORT_DISABLED
        The server doesn't support gzip.
        See Also:
        Constant Field Values
      • GZIP_SUPPORT_ENABLED

        public static final int GZIP_SUPPORT_ENABLED
        The server supports gzip. Responses are only compressed if the request signals "gzip" is an acceptable content-coding using an Accept-Encoding header.
        See Also:
        Constant Field Values
      • GZIP_SUPPORT_FORCED

        public static final int GZIP_SUPPORT_FORCED
        The server supports gzip. Responses are compressed if the request contains no Accept-Encoding header or one that accepts "gzip".

        RFC 2616 14.3 recommends a server use "identity" content-coding if no Accept-Encoding is present, but some servers will still compress responses in this case. This option mimics that behaviour.

        See Also:
        Constant Field Values
    • Method Detail

      • getPath

        public String getPath()
        Returns the path this resource is available at.
      • getData

        public byte[] getData()
        Returns the data served by this resource.
      • supportsRangeRequests

        public boolean supportsRangeRequests()
        Returns true if RFC 7233 range requests should be supported for this resource.
      • resolvesToUnknownLength

        public boolean resolvesToUnknownLength()
        Returns true if the resource should resolve to an unknown length.
      • getGzipSupport

        public @com.google.android.exoplayer2.testutil.WebServerDispatcher.Resource.GzipSupport int getGzipSupport()
        Returns the level of gzip support the server should provide for this resource.