Example usage for org.springframework.data.mongodb.gridfs GridFsResource lastModified

List of usage examples for org.springframework.data.mongodb.gridfs GridFsResource lastModified

Introduction

In this page you can find the example usage for org.springframework.data.mongodb.gridfs GridFsResource lastModified.

Prototype

@Override
    public long lastModified() throws IOException 

Source Link

Usage

From source file:piecework.util.ContentUtility.java

public static ContentResource toContent(GridFsResource resource) throws IOException {
    String resourceId = resource.getId().toString();

    return new BasicContentResource.Builder().contentId(resourceId).contentType(resource.getContentType())
            .filename(resource.getFilename()).location(resource.getFilename())
            .inputStream(resource.getInputStream()).lastModified(resource.lastModified())
            .length(Long.valueOf(resource.contentLength())).build();
}