public class ReactiveGridFsResource extends AbstractResource
GridFSFile based Resource implementation.| Constructor and Description |
|---|
ReactiveGridFsResource(com.mongodb.client.gridfs.model.GridFSFile file,
org.reactivestreams.Publisher<DataBuffer> content)
Creates a new
ReactiveGridFsResource from the given GridFSFile. |
| Modifier and Type | Method and Description |
|---|---|
static ReactiveGridFsResource |
absent(String filename)
Obtain an absent
ReactiveGridFsResource. |
long |
contentLength() |
boolean |
exists() |
String |
getDescription() |
reactor.core.publisher.Flux<DataBuffer> |
getDownloadStream()
Retrieve the download stream using the default chunk size of 256 kB.
|
reactor.core.publisher.Flux<DataBuffer> |
getDownloadStream(int chunkSize)
Retrieve the download stream.
|
String |
getFilename() |
com.mongodb.client.gridfs.model.GridFSFile |
getGridFSFile() |
Object |
getId()
Returns the
Resource's id. |
InputStream |
getInputStream() |
long |
lastModified() |
createRelative, equals, getFile, getFileForLastModifiedCheck, getURI, getURL, hashCode, isFile, isOpen, isReadable, readableChannel, toStringpublic ReactiveGridFsResource(com.mongodb.client.gridfs.model.GridFSFile file,
org.reactivestreams.Publisher<DataBuffer> content)
ReactiveGridFsResource from the given GridFSFile.file - must not be null.content - public static ReactiveGridFsResource absent(String filename)
ReactiveGridFsResource.filename - filename of the absent resource, must not be null.public InputStream getInputStream() throws IllegalStateException
IllegalStateExceptionpublic long contentLength()
throws IOException
contentLength in interface ResourcecontentLength in class AbstractResourceIOExceptionpublic String getFilename() throws IllegalStateException
getFilename in interface ResourcegetFilename in class AbstractResourceIllegalStateExceptionpublic boolean exists()
exists in interface Resourceexists in class AbstractResourcepublic long lastModified()
throws IOException
lastModified in interface ResourcelastModified in class AbstractResourceIOExceptionpublic String getDescription()
public Object getId()
Resource's id.IllegalStateException - if the file does not exists().@Nullable public com.mongodb.client.gridfs.model.GridFSFile getGridFSFile()
GridFSFile. Can be null if absent.public reactor.core.publisher.Flux<DataBuffer> getDownloadStream()
public reactor.core.publisher.Flux<DataBuffer> getDownloadStream(int chunkSize)
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.