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