public class GridFsResource extends InputStreamResource
GridFSDBFile based Resource implementation.| Constructor and Description |
|---|
GridFsResource(com.mongodb.client.gridfs.model.GridFSFile file)
Creates a new
GridFsResource from the given GridFSDBFile. |
GridFsResource(com.mongodb.client.gridfs.model.GridFSFile file,
InputStream inputStream) |
| Modifier and Type | Method and Description |
|---|---|
long |
contentLength() |
String |
getContentType()
Returns the
Resource's content type. |
String |
getFilename() |
Object |
getId()
Returns the
Resource's id. |
long |
lastModified() |
equals, exists, getDescription, getInputStream, hashCode, isOpencreateRelative, getFile, getFileForLastModifiedCheck, getURI, getURL, isFile, isReadable, readableChannel, toStringpublic GridFsResource(com.mongodb.client.gridfs.model.GridFSFile file)
GridFsResource from the given GridFSDBFile.file - must not be null.public GridFsResource(com.mongodb.client.gridfs.model.GridFSFile file,
InputStream inputStream)
public long contentLength()
throws IOException
contentLength in interface ResourcecontentLength in class AbstractResourceIOExceptionpublic String getFilename() throws IllegalStateException
getFilename in interface ResourcegetFilename in class AbstractResourceIllegalStateExceptionpublic long lastModified()
throws IOException
lastModified in interface ResourcelastModified in class AbstractResourceIOExceptionCopyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.