line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: An internal class to list a bucket (List Objects Version 1) |
2
|
|
|
|
|
|
|
$Net::Amazon::S3::Operation::Objects::List::Response::VERSION = '0.991'; |
3
|
|
|
|
|
|
|
use Moose; |
4
|
99
|
|
|
99
|
|
673
|
|
|
99
|
|
|
|
|
233
|
|
|
99
|
|
|
|
|
786
|
|
5
|
|
|
|
|
|
|
extends 'Net::Amazon::S3::Response'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
$_[0]->_data->{bucket}; |
8
|
|
|
|
|
|
|
} |
9
|
5
|
|
|
5
|
0
|
127
|
|
10
|
|
|
|
|
|
|
$_[0]->_data->{prefix}; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
5
|
|
|
5
|
0
|
113
|
$_[0]->_data->{marker}; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
$_[0]->_data->{next_marker}; |
17
|
5
|
|
|
5
|
0
|
113
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
$_[0]->_data->{max_keys}; |
20
|
|
|
|
|
|
|
} |
21
|
8
|
|
|
8
|
0
|
186
|
|
22
|
|
|
|
|
|
|
$_[0]->_data->{is_truncated}; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
5
|
|
|
5
|
0
|
109
|
@{ $_[0]->_data->{contents} }; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
@{ $_[0]->_data->{common_prefixes} }; |
29
|
8
|
|
|
8
|
0
|
206
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my ($self) = @_; |
32
|
|
|
|
|
|
|
|
33
|
9
|
|
|
9
|
0
|
12
|
my $xpc = $self->xpath_context; |
|
9
|
|
|
|
|
213
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
my $data = { |
36
|
|
|
|
|
|
|
bucket => scalar $xpc->findvalue ("/s3:ListBucketResult/s3:Name"), |
37
|
2
|
|
|
2
|
0
|
3
|
prefix => scalar $xpc->findvalue ("/s3:ListBucketResult/s3:Prefix"), |
|
2
|
|
|
|
|
46
|
|
38
|
|
|
|
|
|
|
marker => scalar $xpc->findvalue ("/s3:ListBucketResult/s3:Marker"), |
39
|
|
|
|
|
|
|
next_marker => scalar $xpc->findvalue ("/s3:ListBucketResult/s3:NextMarker"), |
40
|
|
|
|
|
|
|
max_keys => scalar $xpc->findvalue ("/s3:ListBucketResult/s3:MaxKeys"), |
41
|
9
|
|
|
9
|
|
174
|
is_truncated => scalar $xpc->findvalue ("/s3:ListBucketResult/s3:IsTruncated") eq 'true', |
42
|
|
|
|
|
|
|
contents => [], |
43
|
9
|
|
|
|
|
225
|
common_prefixes => [], |
44
|
|
|
|
|
|
|
}; |
45
|
9
|
|
|
|
|
65
|
|
46
|
|
|
|
|
|
|
for my $content ($xpc->findnodes ("/s3:ListBucketResult/s3:Contents")) { |
47
|
|
|
|
|
|
|
push @{ $data->{contents} }, { |
48
|
|
|
|
|
|
|
key => scalar $xpc->findvalue ("./s3:Key", $content), |
49
|
|
|
|
|
|
|
last_modified => scalar $xpc->findvalue ("./s3:LastModified", $content), |
50
|
|
|
|
|
|
|
etag => scalar $xpc->findvalue ("./s3:ETag", $content), |
51
|
|
|
|
|
|
|
size => scalar $xpc->findvalue ("./s3:Size", $content), |
52
|
|
|
|
|
|
|
storage_class => scalar $xpc->findvalue ("./s3:StorageClass", $content), |
53
|
|
|
|
|
|
|
owner => { |
54
|
|
|
|
|
|
|
id => $xpc->findvalue ("./s3:Owner/s3:ID", $content), |
55
|
|
|
|
|
|
|
displayname => $xpc->findvalue ("./s3:Owner/s3:DisplayName", $content), |
56
|
9
|
|
|
|
|
2779
|
}, |
57
|
12
|
|
|
|
|
766
|
}; |
|
12
|
|
|
|
|
40
|
|
58
|
|
|
|
|
|
|
$data->{contents}[-1]{etag} =~ s/^"|"$//g; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
for my $delimiter ($xpc->findnodes ("/s3:ListBucketResult/s3:Delimiter")) { |
62
|
|
|
|
|
|
|
$data->{delimiter} = $xpc->findvalue ('.', $delimiter); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
if (defined $data->{delimiter}) { |
66
|
|
|
|
|
|
|
my $strip_delim = length $data->{delimiter}; |
67
|
|
|
|
|
|
|
|
68
|
12
|
|
|
|
|
4165
|
for my $common_prefix ($xpc->findnodes ("/s3:ListBucketResult/s3:CommonPrefixes")) { |
69
|
|
|
|
|
|
|
my $prefix = $xpc->findvalue ('./s3:Prefix', $common_prefix); |
70
|
|
|
|
|
|
|
$prefix = substr $prefix, 0, -$strip_delim; |
71
|
9
|
|
|
|
|
545
|
push @{ $data->{common_prefixes} }, $prefix; |
72
|
4
|
|
|
|
|
141
|
} |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
9
|
100
|
|
|
|
468
|
return $data; |
76
|
4
|
|
|
|
|
44
|
} |
77
|
|
|
|
|
|
|
|
78
|
4
|
|
|
|
|
14
|
1; |
79
|
6
|
|
|
|
|
137
|
|
80
|
6
|
|
|
|
|
307
|
|
81
|
6
|
|
|
|
|
73
|
=pod |
|
6
|
|
|
|
|
19
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=encoding UTF-8 |
84
|
|
|
|
|
|
|
|
85
|
9
|
|
|
|
|
164
|
=head1 NAME |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Net::Amazon::S3::Operation::Objects::List::Response - An internal class to list a bucket (List Objects Version 1) |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 VERSION |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
version 0.991 |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 DESCRIPTION |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Implements operation L<< ListObjects|https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html >>. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 AUTHOR |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Branislav Zahradník <barney@cpan.org> |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
This software is copyright (c) 2022 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
106
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=cut |