Package com.backblaze.b2.client
Class B2CopyingPartStorer
- java.lang.Object
-
- com.backblaze.b2.client.B2CopyingPartStorer
-
- All Implemented Interfaces:
B2PartStorer
public class B2CopyingPartStorer extends java.lang.Object implements B2PartStorer
This implementation stores a part of a large file by copying from a file that is already stored in B2.
-
-
Constructor Summary
Constructors Constructor Description B2CopyingPartStorer(int partNumber, java.lang.String sourceFileId)
B2CopyingPartStorer(int partNumber, java.lang.String sourceFileId, B2ByteRange byteRangeOrNull)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
getPartNumber()
long
getPartSizeOrThrow()
int
hashCode()
B2Part
storePart(B2LargeFileStorer largeFileStorer, B2UploadListener uploadListener, B2CancellationToken cancellationToken)
Store the part this B2PartStorer is responsible for.
-
-
-
Constructor Detail
-
B2CopyingPartStorer
public B2CopyingPartStorer(int partNumber, java.lang.String sourceFileId)
-
B2CopyingPartStorer
public B2CopyingPartStorer(int partNumber, java.lang.String sourceFileId, B2ByteRange byteRangeOrNull)
-
-
Method Detail
-
getPartNumber
public int getPartNumber()
- Specified by:
getPartNumber
in interfaceB2PartStorer
- Returns:
- The part number this object will store.
-
getPartSizeOrThrow
public long getPartSizeOrThrow() throws B2CannotComputeException
- Specified by:
getPartSizeOrThrow
in interfaceB2PartStorer
- Returns:
- The size of the part that this object will store, or throw if that cannot be determined.
- Throws:
B2CannotComputeException
-
storePart
public B2Part storePart(B2LargeFileStorer largeFileStorer, B2UploadListener uploadListener, B2CancellationToken cancellationToken) throws B2Exception
Description copied from interface:B2PartStorer
Store the part this B2PartStorer is responsible for.- Specified by:
storePart
in interfaceB2PartStorer
- 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.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-