line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Object extension allowing to fetch part of an object |
2
|
|
|
|
|
|
|
$Net::Amazon::S3::Client::Object::Range::VERSION = '0.991'; |
3
|
|
|
|
|
|
|
use Moose 0.85; |
4
|
99
|
|
|
99
|
|
633
|
use MooseX::StrictConstructor 0.16; |
|
99
|
|
|
|
|
1526
|
|
|
99
|
|
|
|
|
645
|
|
5
|
99
|
|
|
99
|
|
551719
|
|
|
99
|
|
|
|
|
1493
|
|
|
99
|
|
|
|
|
630
|
|
6
|
|
|
|
|
|
|
has 'object' |
7
|
|
|
|
|
|
|
=> is => 'ro' |
8
|
|
|
|
|
|
|
=> isa => 'Net::Amazon::S3::Client::Object' |
9
|
|
|
|
|
|
|
=> required => 1 |
10
|
|
|
|
|
|
|
; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has 'range' |
13
|
|
|
|
|
|
|
=> is => 'ro' |
14
|
|
|
|
|
|
|
=> isa => 'Str' |
15
|
|
|
|
|
|
|
=> required => 1 |
16
|
|
|
|
|
|
|
; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my ($self, %args) = shift; |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
2
|
my $response = $self->object->_perform_operation ( |
21
|
|
|
|
|
|
|
'Net::Amazon::S3::Operation::Object::Fetch', |
22
|
1
|
|
|
|
|
33
|
|
23
|
|
|
|
|
|
|
%args, |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
method => 'GET', |
26
|
|
|
|
|
|
|
range => $self->range, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
return $response; |
30
|
|
|
|
|
|
|
} |
31
|
1
|
|
|
|
|
6
|
|
32
|
|
|
|
|
|
|
my $self = shift; |
33
|
|
|
|
|
|
|
return $self->_get->content; |
34
|
|
|
|
|
|
|
} |
35
|
1
|
|
|
1
|
1
|
4
|
|
36
|
1
|
|
|
|
|
4
|
my $self = shift; |
37
|
|
|
|
|
|
|
return $self->_get->decoded_content(@_); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
0
|
1
|
|
my ($self, $callback) = @_; |
41
|
0
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
return $self->_get (filename => $callback)->http_response; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
0
|
1
|
|
my ($self, $filename) = @_; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
return $self->_get (filename => $filename)->http_response; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
0
|
1
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=pod |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=encoding UTF-8 |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 NAME |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Net::Amazon::S3::Client::Object::Range - Object extension allowing to fetch part of an object |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 VERSION |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
version 0.991 |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 SYNOPSIS |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
my $value = $object->range ("bytes=1024-10240")->get; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 DESCRIPTION |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Simple implementation dowloads, see L<use-byte-range-fetches|https://docs.aws.amazon.com/whitepapers/latest/s3-optimizing-performance-best-practices/use-byte-range-fetches.html>. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 METHODS |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Provides same get methods as L<Net::Amazon::S3::Client::Object> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=over |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=item get |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=item get_decoded |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=item get_callback |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item get_filename |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=back |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 SEE ALSO |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
L<Net::Amazon::S3::Client::Object> |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 AUTHOR |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Branislav Zahradník <barney@cpan.org> - since v0.99 |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
This module is a part of L<Net::Amazon::S3> distribution. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 AUTHOR |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Branislav Zahradník <barney@cpan.org> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
This software is copyright (c) 2022 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
111
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=cut |