Package io.tus.java.client
Class TusUpload
- java.lang.Object
- 
- io.tus.java.client.TusUpload
 
- 
 public class TusUpload extends java.lang.ObjectThis class contains information about a file which will be uploaded later. Uploading is not done using this class but usingTusUploaderwhose instances are returned byTusClient.createUpload(TusUpload),TusClient.createUpload(TusUpload)andTusClient.resumeOrCreateUpload(TusUpload).
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetEncodedMetadata()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.StringgetFingerprint()java.io.InputStreamgetInputStream()java.util.Map<java.lang.String,java.lang.String>getMetadata()longgetSize()voidsetFingerprint(java.lang.String fingerprint)voidsetInputStream(java.io.InputStream inputStream)Set the source from which will be read if the file will be later uploaded.voidsetMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)voidsetSize(long size)Set the file's size in bytes.
 
- 
- 
- 
Constructor Detail- 
TusUploadpublic TusUpload() Create a new TusUpload object.
 - 
TusUploadpublic TusUpload(@NotNull java.io.File file) throws java.io.FileNotFoundExceptionCreate a new TusUpload object using the supplied File object. The correspondingInputStream, size and fingerprint will be automatically set.- Parameters:
- file- The file whose content should be later uploaded.
- Throws:
- java.io.FileNotFoundException- Thrown if the file cannot be found.
 
 
- 
 - 
Method Detail- 
getSizepublic long getSize() 
 - 
setSizepublic void setSize(long size) Set the file's size in bytes.- Parameters:
- size- File's size in bytes.
 
 - 
getFingerprintpublic java.lang.String getFingerprint() 
 - 
setFingerprintpublic void setFingerprint(java.lang.String fingerprint) 
 - 
getInputStreampublic java.io.InputStream getInputStream() 
 - 
setInputStreampublic void setInputStream(java.io.InputStream inputStream) Set the source from which will be read if the file will be later uploaded.- Parameters:
- inputStream- The stream which will be read.
 
 - 
setMetadatapublic void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata) 
 - 
getMetadatapublic java.util.Map<java.lang.String,java.lang.String> getMetadata() 
 - 
getEncodedMetadatapublic 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.- Returns:
- Encoded metadata
 
 
- 
 
-