Class TusUpload

    • Constructor Summary

      Constructors 
      Constructor Description
      TusUpload()
      Create a new TusUpload object.
      TusUpload​(java.io.File file)
      Create a new TusUpload object using the supplied File object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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()  
      java.io.InputStream getInputStream()  
      java.util.Map<java.lang.String,​java.lang.String> getMetadata()  
      long getSize()  
      void setFingerprint​(java.lang.String fingerprint)  
      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)  
      void setSize​(long size)
      Set the file's size in bytes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TusUpload

        public TusUpload()
        Create a new TusUpload object.
      • TusUpload

        public TusUpload​(@NotNull
                         java.io.File file)
                  throws java.io.FileNotFoundException
        Create a new TusUpload object using the supplied File object. The corresponding InputStream, 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

      • getSize

        public long getSize()
      • setSize

        public void setSize​(long size)
        Set the file's size in bytes.
        Parameters:
        size - File's size in bytes.
      • getFingerprint

        public java.lang.String getFingerprint()
      • setFingerprint

        public void setFingerprint​(java.lang.String fingerprint)
      • getInputStream

        public java.io.InputStream getInputStream()
      • setInputStream

        public 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.
      • setMetadata

        public void setMetadata​(java.util.Map<java.lang.String,​java.lang.String> metadata)
      • getMetadata

        public java.util.Map<java.lang.String,​java.lang.String> getMetadata()
      • getEncodedMetadata

        public 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