public class Thumbnail extends Object
Class which holds an InputStream with the thumbnail, the size of the stream and the last date modified.
| Modifier and Type | Method and Description |
|---|---|
static Thumbnail |
createFromFile(File file,
com.google.common.net.MediaType mediaType)
Create a thumbnail with a content type and a
File as source. |
static Thumbnail |
createFromResource(org.springframework.core.io.Resource resource,
long lengthOfResource,
com.google.common.net.MediaType mediaType,
Instant lastModifiedDate)
Create a thumbnail with a
MediaType, a Resource as source, the length of the Resource and the last date
modified. |
Instant |
getLastModifiedDate() |
long |
getLengthOfStream() |
com.google.common.net.MediaType |
getMediaType() |
org.springframework.core.io.Resource |
getResource() |
String |
toString() |
public static Thumbnail createFromResource(org.springframework.core.io.Resource resource, long lengthOfResource, com.google.common.net.MediaType mediaType, Instant lastModifiedDate)
Create a thumbnail with a MediaType, a Resource as source, the length of the Resource and the last date
modified.
resource - the resource of the thumbnaillengthOfResource - the length of the resourcemediaType - the media type of the thumbnaillastModifiedDate - the last date modified of the given input streamIllegalArgumentException - if lengthOfStream is smaller then 0public static Thumbnail createFromFile(File file, com.google.common.net.MediaType mediaType)
Create a thumbnail with a content type and a File as source.
file - The file which holds the thumbnail.mediaType - The content type of the thumbnail.IllegalArgumentException - if file cannot be readpublic org.springframework.core.io.Resource getResource()
public long getLengthOfStream()
public com.google.common.net.MediaType getMediaType()
public Instant getLastModifiedDate()
Copyright © 2010 - 2019 edorasware ag. All Rights Reserved.