Class WebServerDispatcher.Resource
- java.lang.Object
-
- com.google.android.exoplayer2.testutil.WebServerDispatcher.Resource
-
- Enclosing class:
- WebServerDispatcher
public static class WebServerDispatcher.Resource extends Object
A resource served byWebServerDispatcher.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWebServerDispatcher.Resource.BuilderBuilder forWebServerDispatcher.Resource.
-
Field Summary
Fields Modifier and Type Field Description static intGZIP_SUPPORT_DISABLEDThe server doesn't support gzip.static intGZIP_SUPPORT_ENABLEDThe server supports gzip.static intGZIP_SUPPORT_FORCEDThe server supports gzip.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WebServerDispatcher.Resource.BuilderbuildUpon()Returns a newWebServerDispatcher.Resource.Builderinitialized with the values from this instance.byte[]getData()Returns the data served by this resource.intgetGzipSupport()Returns the level of gzip support the server should provide for this resource.StringgetPath()Returns the path this resource is available at.booleanresolvesToUnknownLength()Returns true if the resource should resolve to an unknown length.booleansupportsRangeRequests()Returns true if RFC 7233 range requests should be supported for this 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 anAccept-Encodingheader.- 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 noAccept-Encodingheader or one that accepts"gzip".RFC 2616 14.3 recommends a server use
"identity"content-coding if noAccept-Encodingis 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
@GzipSupport public int getGzipSupport()
Returns the level of gzip support the server should provide for this resource.
-
buildUpon
public WebServerDispatcher.Resource.Builder buildUpon()
Returns a newWebServerDispatcher.Resource.Builderinitialized with the values from this instance.
-
-