Interface BodyPartEntity
-
- All Superinterfaces:
BodyPartEntity,HttpEntity,HttpEntity
- All Known Subinterfaces:
UniversalEntity
- All Known Implementing Classes:
HttpEntity.Default,HttpEntity.IndefiniteLength,HttpEntity.Strict
public interface BodyPartEntity extends HttpEntity, BodyPartEntity
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface akka.http.javadsl.model.HttpEntity
HttpEntity.Chunked, HttpEntity.ChunkStreamPart, HttpEntity.CloseDelimited, HttpEntity.Default, HttpEntity.DiscardedEntity, HttpEntity.IndefiniteLength, HttpEntity.Strict
-
Nested classes/interfaces inherited from interface akka.http.scaladsl.model.HttpEntity
HttpEntity.Chunk, HttpEntity.Chunk$, HttpEntity.Chunked, HttpEntity.Chunked$, HttpEntity.ChunkStreamPart, HttpEntity.ChunkStreamPart$, HttpEntity.CloseDelimited, HttpEntity.CloseDelimited$, HttpEntity.Default, HttpEntity.Default$, HttpEntity.DiscardedEntity, HttpEntity.HttpEntityScalaDSLSugar, HttpEntity.HttpEntityScalaDSLSugar$, HttpEntity.IndefiniteLength, HttpEntity.IndefiniteLength$, HttpEntity.LastChunk, HttpEntity.LastChunk$, HttpEntity.Strict, HttpEntity.Strict$, HttpEntity.WithoutKnownLength
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BodyPartEntitywithContentType(ContentType contentType)Creates a copy of this HttpEntity with thecontentTypeoverridden with the given one.BodyPartEntitywithoutSizeLimit()Lift the size limit from this entity by returning a new entity instance which skips the size verification.BodyPartEntitywithSizeLimit(long maxBytes)Apply the given size limit to this entity by returning a new entity instance which automatically verifies that the data stream encapsulated by this instance produces at mostmaxBytesdata bytes.-
Methods inherited from interface akka.http.scaladsl.model.HttpEntity
completionStageCovariant, contentLengthOption, contentType, dataBytes, discardBytes, discardBytes, getContentLengthOption, getContentType, getDataBytes, isChunked, isCloseDelimited, isDefault, isIndefiniteLength, isKnownEmpty, isStrict, toStrict, toStrict, toStrict, toStrict, toStrict, toStrict, transformDataBytes, transformDataBytes, withContentType
-
-
-
-
Method Detail
-
withContentType
BodyPartEntity withContentType(ContentType contentType)
Description copied from interface:HttpEntityCreates a copy of this HttpEntity with thecontentTypeoverridden with the given one.- Specified by:
withContentTypein interfaceHttpEntity- Parameters:
contentType- (undocumented)- Returns:
- (undocumented)
-
withSizeLimit
BodyPartEntity withSizeLimit(long maxBytes)
Description copied from interface:HttpEntityApply the given size limit to this entity by returning a new entity instance which automatically verifies that the data stream encapsulated by this instance produces at mostmaxBytesdata bytes. In case this verification fails the respective stream will be terminated with anEntityStreamExceptioneither directly at materialization time (if the Content-Length is known) or whenever more data bytes than allowed have been read.When called on
Strictentities the method will return the entity itself if the length is within the bound, otherwise aDefaultentity with a single element data stream. This allows for potential refinement of the entity size limit at a later point (before materialization of the data stream).By default all message entities produced by the HTTP layer automatically carry the limit that is defined in the application's
max-content-lengthconfig setting. If the entity is transformed in a way that changes the Content-Length and then another limit is applied then this new limit will be evaluated against the new Content-Length. If the entity is transformed in a way that changes the Content-Length and no new limit is applied then the previous limit will be applied against the previous Content-Length.- Specified by:
withSizeLimitin interfaceHttpEntity- Specified by:
withSizeLimitin interfaceHttpEntity- Parameters:
maxBytes- (undocumented)- Returns:
- (undocumented)
-
withoutSizeLimit
BodyPartEntity withoutSizeLimit()
Description copied from interface:HttpEntityLift the size limit from this entity by returning a new entity instance which skips the size verification.By default all message entities produced by the HTTP layer automatically carry the limit that is defined in the application's
max-content-lengthconfig setting. It is recommended to always keep an upper limit on accepted entities to avoid potential attackers flooding you with too large requests/responses, so use this method with caution.See
HttpEntity.withSizeLimit(long)for more details.- Specified by:
withoutSizeLimitin interfaceHttpEntity- Specified by:
withoutSizeLimitin interfaceHttpEntity- Returns:
- (undocumented)
-
-