public class ByteArrayUploadSource extends AbstractFileTransfer implements UploadSource
Modifier and Type | Field and Description |
---|---|
private byte[] |
data |
Constructor and Description |
---|
ByteArrayUploadSource(java.lang.String name,
byte[] data)
Create a new source file from a byte[].
|
Modifier and Type | Method and Description |
---|---|
java.io.InputStream |
getInputStream()
Get the file data.
|
protected void |
initMetadata(FileMetaData metadata)
Subclasses that are implementing the
UploadSource
interface should override this method and initialize the
metadata instance with information about the loca file. |
getMetadata, getName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMetadata, getName
public ByteArrayUploadSource(java.lang.String name, byte[] data)
name
- The name of the "file"data
- The contents of the fileprotected void initMetadata(FileMetaData metadata)
AbstractFileTransfer
UploadSource
interface should override this method and initialize the
metadata instance with information about the loca file.
This method is called also for DownloadTarget
implementations but can typically be ignored since
the metadata will be overwritten with information from
the remote server.initMetadata
in class AbstractFileTransfer
public java.io.InputStream getInputStream()
getInputStream
in interface UploadSource