public class FileImage extends Image
Constructor and Description |
---|
FileImage(File file,
String mimeType,
String providerId,
boolean defaultImage) |
FileImage(File file,
String mimeType,
String providerId,
boolean defaultImage,
boolean isExternal) |
Modifier and Type | Method and Description |
---|---|
InputStream |
openStream() |
getBytes, getLastModificationDate, getMimeType, getProviderId, getSize, isDefaultImage, isExternal, setExternal, setLastModificationDate, setMimeType, setSize
public FileImage(File file, String mimeType, String providerId, boolean defaultImage)
file
- The file this image is for.mimeType
- The mimetype for this image.providerId
- The identifier of the provider that loaded the imagedefaultImage
- whether the image is a default image or a custom imagepublic FileImage(File file, String mimeType, String providerId, boolean defaultImage, boolean isExternal)
file
- The file this image is for.mimeType
- The mimetype for this image.providerId
- The identifier of the provider that loaded the imagedefaultImage
- whether the image is a default image or a custom imageisExternal
- Set to true, if this image is an external image.public InputStream openStream() throws IOException
openStream
in class Image
FileInputStream
to the file containing the image. You should
explicitly close the stream after processing the image to avoid locked files.IOException
- Thrown, when there was an error opening the stream.Copyright © 2019 Communote team. All rights reserved.