Class UploadPartGenerator
Generates UploadPart objects from a string/stream that encapsulate the data needed for upload requests
- Aws\Glacier\Model\MultipartUpload\UploadPartGenerator implements Serializable, IteratorAggregate, Countable
Located at Aws/Glacier/Model/MultipartUpload/UploadPartGenerator.php
Methods summary
-
public staticfactory ( string|resource|EntityBodyInterface $body, int $partSize )Creates a UploadPartGenerator and wraps the upload body in a Guzzle EntityBody object
-
public staticcreateSingleUploadPart ( string|resource|EntityBodyInterface $body )Creates a single upload part (up to 4GB) useful for the UploadArchive operation
-
public__construct ( Guzzle\Http\EntityBodyInterface $body, int $partSize ) -
publicgetUploadPart ( int $partNumber )Returns a single upload part from the calculated uploads by part number. By default it returns the first, which is useful behavior if there is only one upload.
-
publicgetAllParts ( ) -
publicgetArchiveSize ( ) -
publicgetRootChecksum ( ) -
publicgetPartSize ( ) -
publicserialize ( ) -
publicunserialize ( mixed $serialized ) -
publicgetIterator ( ) -
publiccount ( ) -
protectedgenerateUploadParts ( Guzzle\Http\EntityBodyInterface $body )Performs the work of reading the body stream, creating tree hashes, and creating UploadPartContext objects
-
protectedupdateTotals ( Aws\Glacier\Model\MultipartUpload\UploadPart $part )Updated the upload helper running totals and tree hash with the data from a complete upload part
Methods detail
public static
Aws\Glacier\Model\MultipartUpload\UploadPartGenerator
factory( string|resource|Guzzle\Http\EntityBodyInterface $body, integer $partSize )
Creates a UploadPartGenerator and wraps the upload body in a Guzzle EntityBody object
Parameters
- $body
string|resource|Guzzle\Http\EntityBodyInterface
$body The upload body- $partSize
integer
$partSize The size of parts to split the upload into
Returns
public static
Aws\Glacier\Model\MultipartUpload\UploadPart
createSingleUploadPart( string|resource|Guzzle\Http\EntityBodyInterface $body )
Creates a single upload part (up to 4GB) useful for the UploadArchive operation
Parameters
- $body
string|resource|Guzzle\Http\EntityBodyInterface
$body The upload body
Returns
Throws
Parameters
- $body
Guzzle\Http\EntityBodyInterface
$body The upload body- $partSize
integer
$partSize The size of parts to split the upload into. Default is the 4GB max
Throws
Aws\Common\Exception\InvalidArgumentExceptionwhen the part size is invalid (i.e. not a power of 2 of 1MB)
Aws\Common\Exception\InvalidArgumentExceptionwhen the body is not seekable (must be able to rewind after calculating hashes)
Aws\Common\Exception\InvalidArgumentExceptionwhen the archive size is less than one byte
Returns a single upload part from the calculated uploads by part number. By default it returns the first, which is useful behavior if there is only one upload.
Parameters
- $partNumber
integer
$partNumber The numerical index of the upload
Returns
Throws
Returns
arrayReturns
arrayReturns
stringReturns
stringImplementation of
Implementation of
Implementation of
Implementation of
Performs the work of reading the body stream, creating tree hashes, and creating UploadPartContext objects
Parameters
- $body
Guzzle\Http\EntityBodyInterface
$body The body to create parts from
Updated the upload helper running totals and tree hash with the data from a complete upload part
Parameters
- $part
Aws\Glacier\Model\MultipartUpload\UploadPart
$part The newly completed upload part
Throws
Magic methods summary
Constants summary
integer |
MAX_NUM_PARTS |
10000 |
Properties summary
protected
string
|
$rootChecksum |
#
The root checksum (tree hash) of the entire entity body |
protected
array
|
$uploadParts |
#
List of upload parts generated by this helper |
protected
integer
|
$archiveSize |
#
The total size of the entire upload body |
protected
integer
|
$partSize |
#
Size of upload parts |