Class PathContentProvider
- java.lang.Object
-
- org.eclipse.jetty.client.util.AbstractTypedContentProvider
-
- org.eclipse.jetty.client.util.PathContentProvider
-
- All Implemented Interfaces:
java.lang.Iterable<java.nio.ByteBuffer>
,ContentProvider
,ContentProvider.Typed
@Deprecated(since="2021-05-27") public class PathContentProvider extends AbstractTypedContentProvider
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.A
ContentProvider
for files using JDK 7'sjava.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 viasetByteBufferPool(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
Constructors Constructor Description PathContentProvider(java.lang.String contentType, java.nio.file.Path filePath)
Deprecated.PathContentProvider(java.lang.String contentType, java.nio.file.Path filePath, int bufferSize)
Deprecated.PathContentProvider(java.nio.file.Path filePath)
Deprecated.PathContentProvider(java.nio.file.Path filePath, int bufferSize)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ByteBufferPool
getByteBufferPool()
Deprecated.long
getLength()
Deprecated.boolean
isReproducible()
Deprecated.Whether this ContentProvider can produce exactly the same content more than once.java.util.Iterator<java.nio.ByteBuffer>
iterator()
Deprecated.void
setByteBufferPool(ByteBufferPool byteBufferPool)
Deprecated.-
Methods inherited from class org.eclipse.jetty.client.util.AbstractTypedContentProvider
getContentType
-
-
-
-
Constructor Detail
-
PathContentProvider
public PathContentProvider(java.nio.file.Path filePath) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
PathContentProvider
public PathContentProvider(java.nio.file.Path filePath, int bufferSize) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
PathContentProvider
public PathContentProvider(java.lang.String contentType, java.nio.file.Path filePath) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
PathContentProvider
public PathContentProvider(java.lang.String contentType, java.nio.file.Path filePath, int bufferSize) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
-
Method Detail
-
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:ContentProvider
Whether this ContentProvider can produce exactly the same content more than once.
Implementations should return
true
only 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
HttpClient
implementation 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
public ByteBufferPool getByteBufferPool()
Deprecated.
-
setByteBufferPool
public void setByteBufferPool(ByteBufferPool byteBufferPool)
Deprecated.
-
iterator
public java.util.Iterator<java.nio.ByteBuffer> iterator()
Deprecated.
-
-