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 InputStream
createInputStream()
Create a inputStream : It must be closed by caller !!String
getFileName()
Instant
getLastModified()
Long
getLength()
String
getMimeType()
static StreamFile
of(String fileName, String typeMime, URL resourceUrl)
static StreamFile
of(String fileName, String typeMime, Instant lastModified, long length, InputStreamBuilder inputStreamBuilder)
static StreamFile
of(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:
getFileName
in interfaceVFile
- Returns:
- Nom d'origine du fichier
-
getMimeType
public final String getMimeType()
- Specified by:
getMimeType
in interfaceVFile
- Returns:
- Type mime du fichier
-
getLength
public final Long getLength()
-
getLastModified
public final Instant getLastModified()
- Specified by:
getLastModified
in interfaceVFile
- Returns:
- Date de modification du fichier en milli-secondes.
-
-