Interface BodyPartEntity
- All Superinterfaces:
- BodyPartEntity,- HttpEntity,- HttpEntity
- All Known Subinterfaces:
- UniversalEntity
- All Known Implementing Classes:
- HttpEntity.Default,- HttpEntity.IndefiniteLength,- HttpEntity.Strict
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.pekko.http.javadsl.model.HttpEntityHttpEntity.Chunked, HttpEntity.ChunkStreamPart, HttpEntity.CloseDelimited, HttpEntity.Default, HttpEntity.DiscardedEntity, HttpEntity.IndefiniteLength, HttpEntity.StrictNested classes/interfaces inherited from interface org.apache.pekko.http.scaladsl.model.HttpEntityHttpEntity.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 SummaryModifier and TypeMethodDescriptionwithContentType(ContentType contentType) Creates a copy of this HttpEntity with thecontentTypeoverridden with the given one.Lift the size limit from this entity by returning a new entity instance which skips the size verification.withSizeLimit(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 org.apache.pekko.http.scaladsl.model.HttpEntitycompletionStageCovariant, contentLengthOption, contentType, dataBytes, discardBytes, discardBytes, getContentLengthOption, getContentType, getDataBytes, isChunked, isCloseDelimited, isDefault, isIndefiniteLength, isKnownEmpty, isStrict, toStrict, toStrict, toStrict, toStrict, toStrict, toStrict, transformDataBytes, transformDataBytes, withContentType
- 
Method Details- 
withContentTypeDescription copied from interface:HttpEntityCreates a copy of this HttpEntity with thecontentTypeoverridden with the given one.- Specified by:
- withContentTypein interface- HttpEntity
- Parameters:
- contentType- (undocumented)
- Returns:
- (undocumented)
 
- 
withSizeLimitDescription 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 interface- HttpEntity
- Specified by:
- withSizeLimitin interface- HttpEntity
- Parameters:
- maxBytes- (undocumented)
- Returns:
- (undocumented)
 
- 
withoutSizeLimitBodyPartEntity 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 interface- HttpEntity
- Specified by:
- withoutSizeLimitin interface- HttpEntity
- Returns:
- (undocumented)
 
 
-