Class ByteArrayUploadSource
java.lang.Object
net.sf.basedb.opengrid.filetransfer.AbstractFileTransfer
net.sf.basedb.opengrid.filetransfer.ByteArrayUploadSource
- All Implemented Interfaces:
UploadSource
- Direct Known Subclasses:
StringUploadSource
Upload source implementation for uploading the contents
of a string to a file on a remote server.
- Since:
- 1.0
- Author:
- nicklas
-
Field Summary
-
Constructor Summary
ConstructorDescriptionByteArrayUploadSource
(String name, byte[] data) Create a new source file from a byte[]. -
Method Summary
Modifier and TypeMethodDescriptionGet the file data.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.Methods inherited from class net.sf.basedb.opengrid.filetransfer.AbstractFileTransfer
getMetadata, getName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.sf.basedb.opengrid.filetransfer.UploadSource
getMetadata, getName
-
Field Details
-
data
private final byte[] data
-
-
Constructor Details
-
ByteArrayUploadSource
Create a new source file from a byte[].- Parameters:
name
- The name of the "file"data
- The contents of the file
-
-
Method Details
-
initMetadata
Description copied from class:AbstractFileTransfer
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.- Overrides:
initMetadata
in classAbstractFileTransfer
-
getInputStream
Get the file data.- Specified by:
getInputStream
in interfaceUploadSource
-