public class TusUpload
extends java.lang.Object
TusUploader
whose instances are returned by
TusClient.createUpload(TusUpload)
, TusClient.createUpload(TusUpload)
and
TusClient.resumeOrCreateUpload(TusUpload)
.Constructor and Description |
---|
TusUpload()
Create a new TusUpload object.
|
TusUpload(java.io.File file)
Create a new TusUpload object using the supplied file object.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getEncodedMetadata()
Encode the metadata into a string according to the specification, so it can be
used as the value for the Upload-Metadata header.
|
java.lang.String |
getFingerprint()
Returns the file specific fingerprint.
|
java.io.InputStream |
getInputStream()
Returns the input stream of the file to upload.
|
java.util.Map<java.lang.String,java.lang.String> |
getMetadata()
This method returns the upload's metadata as Map.
|
long |
getSize()
Returns the file size of the upload.
|
void |
setFingerprint(java.lang.String fingerprint)
Sets a fingerprint for this upload.
|
void |
setInputStream(java.io.InputStream inputStream)
Set the source from which will be read if the file will be later uploaded.
|
void |
setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
This methods allows it to send Metadata alongside with the upload.
|
void |
setSize(long size)
Set the file's size in bytes.
|
public TusUpload()
public TusUpload(@NotNull java.io.File file) throws java.io.FileNotFoundException
InputStream
, size and fingerprint will be automatically set.file
- The file whose content should be later uploaded.java.io.FileNotFoundException
- Thrown if the file cannot be found.public long getSize()
public void setSize(long size)
size
- File's size in bytes.public java.lang.String getFingerprint()
public void setFingerprint(java.lang.String fingerprint)
fingerprint
- String of fingerprint information.public java.io.InputStream getInputStream()
InputStream
public void setInputStream(java.io.InputStream inputStream)
inputStream
- The stream which will be read.public void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
metadata
- Key-value pairs of Type Stringpublic java.util.Map<java.lang.String,java.lang.String> getMetadata()
Map
of metadata Key - Value pairs.public java.lang.String getEncodedMetadata()