Class PathContentProvider
- All Implemented Interfaces:
Iterable<ByteBuffer>,ContentProvider,ContentProvider.Typed
A ContentProvider for files using JDK 7's java.nio.file APIs.
It is possible to specify, at the constructor, a buffer size used to read
content from the stream, by default 4096 bytes.
If a ByteBufferPool is provided via setByteBufferPool(ByteBufferPool),
the buffer will be allocated from that pool, otherwise one buffer will be
allocated and used to read the file.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.client.api.ContentProvider
ContentProvider.Typed -
Constructor Summary
ConstructorsConstructorDescriptionPathContentProvider(String contentType, Path filePath) Deprecated.PathContentProvider(String contentType, Path filePath, int bufferSize) Deprecated.PathContentProvider(Path filePath) Deprecated.PathContentProvider(Path filePath, int bufferSize) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.longDeprecated.booleanDeprecated.Whether this ContentProvider can produce exactly the same content more than once.booleanDeprecated.iterator()Deprecated.voidsetByteBufferPool(ByteBufferPool byteBufferPool) Deprecated.voidsetUseDirectByteBuffers(boolean useDirectByteBuffers) Deprecated.Methods inherited from class org.eclipse.jetty.client.util.AbstractTypedContentProvider
getContentTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PathContentProvider
Deprecated.- Throws:
IOException
-
PathContentProvider
Deprecated.- Throws:
IOException
-
PathContentProvider
Deprecated.- Throws:
IOException
-
PathContentProvider
Deprecated.- Throws:
IOException
-
-
Method Details
-
getLength
public long getLength()Deprecated.- Returns:
- the content length, if known, or -1 if the content length is unknown
-
isReproducible
public boolean isReproducible()Deprecated.Description copied from interface:ContentProviderWhether this ContentProvider can produce exactly the same content more than once.
Implementations should return
trueonly if the content can be produced more than once, which means that invocations toIterable.iterator()must return a new, independent, iterator instance over the content.The
HttpClientimplementation may use this method in particular cases where it detects that it is safe to retry a request that failed.- Returns:
- whether the content can be produced more than once
-
getByteBufferPool
Deprecated. -
setByteBufferPool
Deprecated. -
isUseDirectByteBuffers
public boolean isUseDirectByteBuffers()Deprecated. -
setUseDirectByteBuffers
public void setUseDirectByteBuffers(boolean useDirectByteBuffers) Deprecated. -
iterator
Deprecated.
-
PathRequestContentinstead.