Class InputStreamUploadSource
java.lang.Object
net.sf.basedb.opengrid.filetransfer.InputStreamUploadSource
- All Implemented Interfaces:
UploadSource
public class InputStreamUploadSource extends Object implements UploadSource
Generic upload source implementation that simply wraps an
existing input stream. File metadata is optional.
- Since:
- 1.0
- Author:
- nicklas
-
Field Summary
Fields Modifier and Type Field Description private InputStream
in
private FileMetaData
metadata
private String
name
-
Constructor Summary
Constructors Constructor Description InputStreamUploadSource(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 Type Method Description InputStream
getInputStream()
Get an input stream for reading the resource data.FileMetaData
getMetadata()
Get a metadata instance with information about the local file that is about to be uploaded.String
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
-