public class TransferFile
extends java.lang.Object
Path or as InputStream.| Constructor and Description |
|---|
TransferFile(java.nio.file.Path filePath)
Creates a new
TransferFile object with the given file path,
representing an actual file on the file system. |
TransferFile(java.lang.String fileName,
java.io.InputStream fileInputStream,
long size)
Creates a new
TransferFile object with the given file name, input stream and file size. |
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
getFileInputStream()
Returns the
InputStream to get the file, if specified. |
long |
getFileInputStreamLength()
Returns the specified size of the file, defined by the
InputStream, see getFileInputStream() |
java.lang.String |
getFileName()
Returns the name of the file.
|
java.nio.file.Path |
getFilePath()
Returns the file path, if specified.
|
java.lang.String |
getId()
Returns the unique ID for this transfer file.
|
public TransferFile(java.nio.file.Path filePath)
TransferFile object with the given file path,
representing an actual file on the file system.filePath - The path to the file on the file system.public TransferFile(java.lang.String fileName,
java.io.InputStream fileInputStream,
long size)
TransferFile object with the given file name, input stream and file size.
The file size is required to calculate the total transfer size.fileName - The name of the streamed file.fileInputStream - The input stream containing the data to be transferred. The input stream will be automatically closed when the data has been
uploaded to the server.size - The length of the input stream in bytes.java.lang.IllegalArgumentException - If the stream size is less than 0.public java.nio.file.Path getFilePath()
null, if the TransferFile has been constructed using
an InputStream instead.public java.lang.String getFileName()
public java.io.InputStream getFileInputStream()
InputStream to get the file, if specified.InputStream or null, if the TransferFile has been constructed using
an Path instead.public long getFileInputStreamLength()
InputStream, see getFileInputStream()public java.lang.String getId()