org.springframework.data.mongodb.gridfs
Class GridFsResource
java.lang.Object
org.springframework.core.io.AbstractResource
org.springframework.core.io.InputStreamResource
org.springframework.data.mongodb.gridfs.GridFsResource
- All Implemented Interfaces:
- org.springframework.core.io.InputStreamSource, org.springframework.core.io.Resource
public class GridFsResource
- extends org.springframework.core.io.InputStreamResource
GridFSDBFile based Resource implementation.
- Author:
- Oliver Gierke
| Methods inherited from class org.springframework.core.io.InputStreamResource |
equals, exists, getDescription, getInputStream, hashCode, isOpen |
| Methods inherited from class org.springframework.core.io.AbstractResource |
createRelative, getFile, getFileForLastModifiedCheck, getURI, getURL, isReadable, toString |
GridFsResource
public GridFsResource(com.mongodb.gridfs.GridFSDBFile file)
- Creates a new
GridFsResource from the given GridFSDBFile.
- Parameters:
file - must not be null.
contentLength
public long contentLength()
throws IOException
- Specified by:
contentLength in interface org.springframework.core.io.Resource- Overrides:
contentLength in class org.springframework.core.io.AbstractResource
- Throws:
IOException
getFilename
public String getFilename()
throws IllegalStateException
- Specified by:
getFilename in interface org.springframework.core.io.Resource- Overrides:
getFilename in class org.springframework.core.io.AbstractResource
- Throws:
IllegalStateException
lastModified
public long lastModified()
throws IOException
- Specified by:
lastModified in interface org.springframework.core.io.Resource- Overrides:
lastModified in class org.springframework.core.io.AbstractResource
- Throws:
IOException
getId
public Object getId()
- Returns the
Resource's id.
- Returns:
getContentType
public String getContentType()
- Returns the
Resource's content type.
- Returns:
Copyright © 2012. All Rights Reserved.