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.
|
String |
getFilename() |
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().public reactor.core.publisher.Flux<DataBuffer> getDownloadStream()
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.