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:
- InputStreamSource, Resource
public class GridFsResource
- extends InputStreamResource
GridFSDBFile based Resource implementation.
- Author:
- Oliver Gierke
GridFsResource
public GridFsResource(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 Resource- Overrides:
contentLength in class AbstractResource
- Throws:
IOException
getFilename
public String getFilename()
throws IllegalStateException
- Specified by:
getFilename in interface Resource- Overrides:
getFilename in class AbstractResource
- Throws:
IllegalStateException
lastModified
public long lastModified()
throws IOException
- Specified by:
lastModified in interface Resource- Overrides:
lastModified in class 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.