|
|
|
@ -23,7 +23,6 @@ import org.springframework.core.io.InputStreamResource; |
|
|
|
import org.springframework.core.io.Resource; |
|
|
|
import org.springframework.core.io.Resource; |
|
|
|
|
|
|
|
|
|
|
|
import com.mongodb.client.gridfs.model.GridFSFile; |
|
|
|
import com.mongodb.client.gridfs.model.GridFSFile; |
|
|
|
import com.mongodb.gridfs.GridFSDBFile; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* {@link GridFSFile} based {@link Resource} implementation. |
|
|
|
* {@link GridFSFile} based {@link Resource} implementation. |
|
|
|
@ -89,7 +88,7 @@ public class GridFsResource extends InputStreamResource { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the {@link Resource}'s id. |
|
|
|
* Returns the {@link Resource}'s id. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return |
|
|
|
* @return never {@literal null}. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Object getId() { |
|
|
|
public Object getId() { |
|
|
|
return file.getId(); |
|
|
|
return file.getId(); |
|
|
|
@ -98,7 +97,9 @@ public class GridFsResource extends InputStreamResource { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the {@link Resource}'s content type. |
|
|
|
* Returns the {@link Resource}'s content type. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return |
|
|
|
* @return never {@literal null}. |
|
|
|
|
|
|
|
* @throws com.mongodb.MongoGridFSException in case no content type declared on {@link GridFSFile#getMetadata()} nor |
|
|
|
|
|
|
|
* provided via {@link GridFSFile#getContentType()}. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@SuppressWarnings("deprecation") |
|
|
|
@SuppressWarnings("deprecation") |
|
|
|
public String getContentType() { |
|
|
|
public String getContentType() { |
|
|
|
|