Class B2UploadingPartStorer

  • All Implemented Interfaces:
    B2PartStorer

    public class B2UploadingPartStorer
    extends java.lang.Object
    implements B2PartStorer
    This implementation stores a part of a large file by uploading the bytes from a B2ContentSource.
    • Constructor Detail

      • B2UploadingPartStorer

        public B2UploadingPartStorer​(int partNumber,
                                     B2ContentSource contentSource)
    • Method Detail

      • getPartNumber

        public int getPartNumber()
        Specified by:
        getPartNumber in interface B2PartStorer
        Returns:
        The part number this object will store.
      • storePart

        public B2Part storePart​(B2LargeFileStorer largeFileStorer,
                                B2UploadListener uploadListener,
                                B2CancellationToken cancellationToken)
                         throws java.io.IOException,
                                B2Exception
        Description copied from interface: B2PartStorer
        Store the part this B2PartStorer is responsible for.
        Specified by:
        storePart in interface B2PartStorer
        Parameters:
        largeFileStorer - The object managing the storage of the whole large file.
        uploadListener - The listener that tracks upload progress events.
        cancellationToken - token to check whether the action has been cancelled
        Returns:
        The part that is stored, if successful.
        Throws:
        B2Exception - if there's trouble.
        java.io.IOException
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object