Class InputStreamUploadSource
java.lang.Object
net.sf.basedb.opengrid.filetransfer.InputStreamUploadSource
- All Implemented Interfaces:
UploadSource
Generic upload source implementation that simply wraps an
existing input stream. File metadata is optional.
- Since:
- 1.0
- Author:
- nicklas
-
Field Summary
Modifier and TypeFieldDescriptionprivate final InputStream
private final FileMetaData
private final String
-
Constructor Summary
ConstructorDescriptionInputStreamUploadSource
(String name, InputStream in) Create a new upload source from the existing input stream.InputStreamUploadSource
(String name, InputStream in, FileMetaData metadata) Create a new upload source from the existing input stream and file metadata. -
Method Summary
Modifier and TypeMethodDescriptionGet an input stream for reading the resource data.Get a metadata instance with information about the local file that is about to be uploaded.getName()
The name of the resource.
-
Field Details
-
name
-
in
-
metadata
-
-
Constructor Details
-
InputStreamUploadSource
Create a new upload source from the existing input stream. -
InputStreamUploadSource
Create a new upload source from the existing input stream and file metadata.
-
-
Method Details
-
getName
Description copied from interface:UploadSource
The name of the resource.- Specified by:
getName
in interfaceUploadSource
-
getMetadata
Description copied from interface:UploadSource
Get a metadata instance with information about the local file that is about to be uploaded. This method is called before theUploadSource.getInputStream()
is called.- Specified by:
getMetadata
in interfaceUploadSource
- Returns:
- A metadata instance or null if no metadata is known
-
getInputStream
Description copied from interface:UploadSource
Get an input stream for reading the resource data.- Specified by:
getInputStream
in interfaceUploadSource
-