Class StreamFile
- java.lang.Object
-
- io.vertigo.datastore.impl.filestore.model.StreamFile
-
- All Implemented Interfaces:
VFile,Serializable
public final class StreamFile extends Object
VFile implementation from a provided InputStreamBuilder.- Author:
- npiedeloup
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StreamFile(String fileName, String mimeType, Instant lastModified, long length, InputStreamBuilder inputStreamBuilder)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamcreateInputStream()Create a inputStream : It must be closed by caller !!StringgetFileName()InstantgetLastModified()LonggetLength()StringgetMimeType()static StreamFileof(String fileName, String typeMime, URL resourceUrl)static StreamFileof(String fileName, String typeMime, Instant lastModified, long length, InputStreamBuilder inputStreamBuilder)static StreamFileof(String fileName, Instant lastModified, long length, InputStreamBuilder inputStreamBuilder)
-
-
-
Constructor Detail
-
StreamFile
public StreamFile(String fileName, String mimeType, Instant lastModified, long length, InputStreamBuilder inputStreamBuilder)
Constructor.- Parameters:
fileName- File namemimeType- Mime typelastModified- Last modified datelength- file sizeinputStreamBuilder- Data stream builder
-
-
Method Detail
-
createInputStream
public InputStream createInputStream() throws IOException
Create a inputStream : It must be closed by caller !!- Returns:
- Stream représentant le document physique.
- Throws:
IOException- Erreur d'entrée/sortie
-
of
public static StreamFile of(String fileName, Instant lastModified, long length, InputStreamBuilder inputStreamBuilder)
-
of
public static StreamFile of(String fileName, String typeMime, URL resourceUrl)
-
of
public static StreamFile of(String fileName, String typeMime, Instant lastModified, long length, InputStreamBuilder inputStreamBuilder)
-
getFileName
public final String getFileName()
- Specified by:
getFileNamein interfaceVFile- Returns:
- Nom d'origine du fichier
-
getMimeType
public final String getMimeType()
- Specified by:
getMimeTypein interfaceVFile- Returns:
- Type mime du fichier
-
getLength
public final Long getLength()
-
getLastModified
public final Instant getLastModified()
- Specified by:
getLastModifiedin interfaceVFile- Returns:
- Date de modification du fichier en milli-secondes.
-
-