Class PutTaskRequestContent
java.lang.Object
org.eclipse.jetty.io.content.ByteBufferContentSource
org.eclipse.jetty.client.ByteBufferRequestContent
org.eclipse.aether.transport.jetty.PutTaskRequestContent
- All Implemented Interfaces:
org.eclipse.jetty.client.Request.Content,org.eclipse.jetty.io.Content.Source
public class PutTaskRequestContent
extends org.eclipse.jetty.client.ByteBufferRequestContent
implements org.eclipse.jetty.client.Request.Content
Heavily inspired by Jetty's
org.eclipse.jetty.io.internal.ByteChannelContentSource but adjusted to deal with
ReadableByteChannels and to support rewind (to be able to retry the requests).
Also, Jetty's ByteChannelContentSource is an internal package so should not be used directly.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Content.Source
org.eclipse.jetty.io.Content.Source.Factory -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPutTaskRequestContent(org.eclipse.jetty.io.ByteBufferPool.Sized byteBufferPool, Supplier<ReadableByteChannel> newByteChannelSupplier) Create aByteChannelContentSourcewhich reads from aByteChannel.protectedPutTaskRequestContent(org.eclipse.jetty.io.ByteBufferPool.Sized byteBufferPool, Supplier<ReadableByteChannel> newByteChannelSupplier, long offset, long length) Create aByteChannelContentSourcewhich reads from aByteChannel. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidstatic org.eclipse.jetty.client.Request.Contentlongprotected voidlockedSetTerminal(org.eclipse.jetty.io.Content.Chunk terminal) protected ReadableByteChannelopen()org.eclipse.jetty.io.Content.Chunkread()booleanrewind()Methods inherited from class org.eclipse.jetty.client.ByteBufferRequestContent
getContentTypeMethods inherited from class org.eclipse.jetty.io.content.ByteBufferContentSource
getByteBuffersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.jetty.io.Content.Source
failMethods inherited from interface org.eclipse.jetty.client.Request.Content
getContentType
-
Constructor Details
-
PutTaskRequestContent
protected PutTaskRequestContent(org.eclipse.jetty.io.ByteBufferPool.Sized byteBufferPool, Supplier<ReadableByteChannel> newByteChannelSupplier) Create aByteChannelContentSourcewhich reads from aByteChannel.- Parameters:
byteBufferPool- TheByteBufferPool.Sizedto use for any internal buffers.newByteChannelSupplier- TheByteChannelsupplier.
-
PutTaskRequestContent
protected PutTaskRequestContent(org.eclipse.jetty.io.ByteBufferPool.Sized byteBufferPool, Supplier<ReadableByteChannel> newByteChannelSupplier, long offset, long length) Create aByteChannelContentSourcewhich reads from aByteChannel. If theByteChannelis an instance ofSeekableByteChannelthe implementation will useSeekableByteChannel.position(long)to navigate to the starting offset.- Parameters:
byteBufferPool- TheByteBufferPool.Sizedto use for any internal buffers.newByteChannelSupplier- TheByteChannelsupplier.offset- the offset byte of the content to start from. Must be greater than or equal to 0 and less than the content length (if known).length- the length of the content to make available, -1 for the full length. If the size of the content is known, the length may be truncated to the content size minus the offset.- Throws:
IndexOutOfBoundsException- if the offset or length are out of range.- See Also:
-
-
Method Details
-
from
-
open
- Throws:
IOException
-
demand
- Specified by:
demandin interfaceorg.eclipse.jetty.io.Content.Source- Overrides:
demandin classorg.eclipse.jetty.io.content.ByteBufferContentSource
-
lockedSetTerminal
-
read
- Specified by:
readin interfaceorg.eclipse.jetty.io.Content.Source- Overrides:
readin classorg.eclipse.jetty.io.content.ByteBufferContentSource
-
fail
- Specified by:
failin interfaceorg.eclipse.jetty.io.Content.Source- Overrides:
failin classorg.eclipse.jetty.io.content.ByteBufferContentSource
-
getLength
- Specified by:
getLengthin interfaceorg.eclipse.jetty.io.Content.Source- Overrides:
getLengthin classorg.eclipse.jetty.io.content.ByteBufferContentSource
-
rewind
- Specified by:
rewindin interfaceorg.eclipse.jetty.io.Content.Source- Overrides:
rewindin classorg.eclipse.jetty.io.content.ByteBufferContentSource
-