Class HttpEntity.Strict
- All Implemented Interfaces:
- Serializable,- BodyPartEntity,- HttpEntity,- HttpEntity.Strict,- RequestEntity,- ResponseEntity,- UniversalEntity,- BodyPartEntity,- HttpEntity,- RequestEntity,- ResponseEntity,- UniversalEntity,- scala.Equals,- scala.Product
- Enclosing interface:
- HttpEntity
- See Also:
- 
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
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionlongTheContentTypeassociated with this entity.org.apache.pekko.util.ByteStringdata()org.apache.pekko.stream.scaladsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed> A stream of the data of this entity.org.apache.pekko.util.ByteStringgetData()Java APIbooleanReturns if this entity is known to be empty.booleanisStrict()Returns if this entity is a subtype of HttpEntityStrict.scala.concurrent.Future<HttpEntity.Strict>toStrict(scala.concurrent.duration.FiniteDuration timeout, org.apache.pekko.stream.Materializer fm) Collects all possible parts and returns a potentially future Strict entity for easier processing.toString()transformDataBytes(org.apache.pekko.stream.scaladsl.Flow<org.apache.pekko.util.ByteString, org.apache.pekko.util.ByteString, Object> transformer) Returns a copy of the given entity with the ByteString chunks of this entity transformed by the given transformer.withContentType(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 most `maxBytes` data bytes.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface scala.EqualscanEqual, equalsMethods inherited from interface org.apache.pekko.http.scaladsl.model.HttpEntitycompletionStageCovariant, discardBytes, discardBytes, getContentLengthOption, getContentType, getDataBytes, isChunked, isCloseDelimited, isDefault, isIndefiniteLength, toStrict, toStrict, toStrict, toStrict, toStrict, transformDataBytes, withContentTypeMethods inherited from interface scala.ProductproductArity, productElement, productElementName, productElementNames, productIteratorMethods inherited from interface org.apache.pekko.http.scaladsl.model.UniversalEntitycontentLengthOption
- 
Constructor Details- 
Strict
 
- 
- 
Method Details- 
contentTypeDescription copied from interface:HttpEntityTheContentTypeassociated with this entity.- Specified by:
- contentTypein interface- HttpEntity
- Returns:
- (undocumented)
 
- 
datapublic org.apache.pekko.util.ByteString data()
- 
contentLengthpublic long contentLength()- Specified by:
- contentLengthin interface- UniversalEntity
 
- 
isKnownEmptypublic boolean isKnownEmpty()Description copied from interface:HttpEntityReturns if this entity is known to be empty. Open-ended entity types like HttpEntityChunked and HttpCloseDelimited will always return false here.- Specified by:
- isKnownEmptyin interface- HttpEntity
- Specified by:
- isKnownEmptyin interface- HttpEntity
- Returns:
- (undocumented)
 
- 
isStrictpublic boolean isStrict()Description copied from interface:HttpEntityReturns if this entity is a subtype of HttpEntityStrict.- Specified by:
- isStrictin interface- HttpEntity
- Specified by:
- isStrictin interface- HttpEntity
 
- 
dataBytespublic org.apache.pekko.stream.scaladsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed> dataBytes()Description copied from interface:HttpEntityA stream of the data of this entity.- Specified by:
- dataBytesin interface- HttpEntity
- Returns:
- (undocumented)
 
- 
toStrictpublic scala.concurrent.Future<HttpEntity.Strict> toStrict(scala.concurrent.duration.FiniteDuration timeout, org.apache.pekko.stream.Materializer fm) Description copied from interface:HttpEntityCollects all possible parts and returns a potentially future Strict entity for easier processing. The Future is failed with an TimeoutException if the stream isn't completed after the given timeout, or with a EntityStreamException when the end of the entity is not reached within the maximum number of bytes as configured inpekko.http.parsing.max-to-strict-bytes. Not that this method does not support different defaults for client- and server use: if you want that, use thetoStrictmethod and pass in an explicit maximum number of bytes.- Specified by:
- toStrictin interface- HttpEntity
- Parameters:
- timeout- (undocumented)
- fm- (undocumented)
- Returns:
- (undocumented)
 
- 
transformDataBytespublic RequestEntity transformDataBytes(org.apache.pekko.stream.scaladsl.Flow<org.apache.pekko.util.ByteString, org.apache.pekko.util.ByteString, Object> transformer) Description copied from interface:HttpEntityReturns a copy of the given entity with the ByteString chunks of this entity transformed by the given transformer. For aChunkedentity, the chunks will be transformed one by one keeping the chunk metadata (but may introduce an extra chunk before theLastChunkiftransformer.onTerminationreturns additional data).This method may only throw an exception if the transformerfunction throws an exception while creating the transformer. Any other errors are reported through the new entity data stream.- Specified by:
- transformDataBytesin interface- HttpEntity
- Specified by:
- transformDataBytesin interface- RequestEntity
- Specified by:
- transformDataBytesin interface- ResponseEntity
- Parameters:
- transformer- (undocumented)
- Returns:
- (undocumented)
 
- 
withContentTypeDescription copied from interface:HttpEntityCreates a copy of this HttpEntity with thecontentTypeoverridden with the given one.- Specified by:
- withContentTypein interface- BodyPartEntity
- Specified by:
- withContentTypein interface- HttpEntity
- Specified by:
- withContentTypein interface- RequestEntity
- Specified by:
- withContentTypein interface- ResponseEntity
- Specified by:
- withContentTypein interface- UniversalEntity
- 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 most `maxBytes` data bytes. In case this verification fails the respective stream will be terminated with an `EntityStreamException` either directly at materialization time (if the Content-Length is known) or whenever more data bytes than allowed have been read.When called on `Strict` entities the method will return the entity itself if the length is within the bound, otherwise a `Default` entity 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-length` config 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- BodyPartEntity
- Specified by:
- withSizeLimitin interface- HttpEntity
- Specified by:
- withSizeLimitin interface- HttpEntity
- Specified by:
- withSizeLimitin interface- RequestEntity
- Specified by:
- withSizeLimitin interface- ResponseEntity
- Specified by:
- withSizeLimitin interface- UniversalEntity
- Parameters:
- maxBytes- (undocumented)
- Returns:
- (undocumented)
 
- 
withoutSizeLimitDescription 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-length` config 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 [[withSizeLimit]] for more details. - Specified by:
- withoutSizeLimitin interface- BodyPartEntity
- Specified by:
- withoutSizeLimitin interface- HttpEntity
- Specified by:
- withoutSizeLimitin interface- HttpEntity
- Specified by:
- withoutSizeLimitin interface- RequestEntity
- Specified by:
- withoutSizeLimitin interface- ResponseEntity
- Specified by:
- withoutSizeLimitin interface- UniversalEntity
- Returns:
- (undocumented)
 
- 
productPrefix- Specified by:
- productPrefixin interface- scala.Product
 
- 
toString
- 
getDatapublic org.apache.pekko.util.ByteString getData()Java API- Specified by:
- getDatain interface- HttpEntity.Strict
 
 
-