Class AbstractFileTransfer
java.lang.Object
net.sf.basedb.opengrid.filetransfer.AbstractFileTransfer
- Direct Known Subclasses:
BaseFileDownloadTarget
,BaseFileUploadSource
,ByteArrayDownloadTarget
,ByteArrayUploadSource
,OutputStreamDownloadTarget
,ServletResponseDownloadTarget
Abstract base implementation that is suitable when implementing
both file upload and download. This class provides functionality
that is common to both the
DownloadTarget
and UploadSource
interfaces, eg. the name and file metdata information.
DownloadTarget
implementations only need to extend this class and
implement the DownloadTarget.getOutputStream()
method. File metadata
about the remote file should be available in the getMetadata()
instance when the DownloadTarget.getOutputStream()
method is called.
UploadSource
implementations that are extending this class
need to implement the UploadSource.getInputStream()
method.
If file metadata is important the implementation should call
getMetadata()
and initialize the information before the
UploadSource.getInputStream()
method is called.- Since:
- 1.0
- Author:
- nicklas
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet metadata about the local file or receive metadata for the remote file.getName()
Get the name of the file.protected void
initMetadata
(FileMetaData metadata) Subclasses that are implementing theUploadSource
interface should override this method and initialize the metadata instance with information about the loca file.
-
Field Details
-
name
-
metadata
-
-
Constructor Details
-
AbstractFileTransfer
-
-
Method Details
-
getName
Get the name of the file.- See Also:
-
getMetadata
Get metadata about the local file or receive metadata for the remote file.- See Also:
-
initMetadata
Subclasses that are implementing theUploadSource
interface should override this method and initialize the metadata instance with information about the loca file. This method is called also forDownloadTarget
implementations but can typically be ignored since the metadata will be overwritten with information from the remote server.
-