line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Connector::Builtin::File::Simple |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Proxy class for accessing simple file |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# Written by Martin Bartosch for the OpenXPKI project 2012 |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use strict; |
9
|
1
|
|
|
1
|
|
89970
|
use warnings; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
26
|
|
10
|
1
|
|
|
1
|
|
4
|
use English; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
11
|
1
|
|
|
1
|
|
5
|
use File::Spec; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
12
|
1
|
|
|
1
|
|
348
|
use Data::Dumper; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
19
|
|
13
|
1
|
|
|
1
|
|
517
|
|
|
1
|
|
|
|
|
5846
|
|
|
1
|
|
|
|
|
52
|
|
14
|
|
|
|
|
|
|
use Moose; |
15
|
1
|
|
|
1
|
|
440
|
extends 'Connector::Builtin'; |
|
1
|
|
|
|
|
381738
|
|
|
1
|
|
|
|
|
4
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $self = shift; |
19
|
|
|
|
|
|
|
|
20
|
3
|
|
|
3
|
1
|
8
|
my $filename = $self->{LOCATION}; |
21
|
|
|
|
|
|
|
|
22
|
3
|
|
|
|
|
6
|
if (! -r $filename) { |
23
|
|
|
|
|
|
|
return $self->_node_not_exists( ); |
24
|
3
|
50
|
|
|
|
84
|
} |
25
|
0
|
|
|
|
|
0
|
|
26
|
|
|
|
|
|
|
my $content = do { |
27
|
|
|
|
|
|
|
local $INPUT_RECORD_SEPARATOR; |
28
|
3
|
|
|
|
|
8
|
open my $fh, '<', $filename; |
29
|
3
|
|
|
|
|
29
|
<$fh>; |
30
|
3
|
|
|
|
|
90
|
}; |
31
|
3
|
|
|
|
|
113
|
|
32
|
|
|
|
|
|
|
return $content; |
33
|
|
|
|
|
|
|
} |
34
|
3
|
|
|
|
|
20
|
|
35
|
|
|
|
|
|
|
my $self = shift; |
36
|
|
|
|
|
|
|
return { TYPE => "scalar" }; |
37
|
|
|
|
|
|
|
} |
38
|
0
|
|
|
0
|
1
|
0
|
|
39
|
0
|
|
|
|
|
0
|
|
40
|
|
|
|
|
|
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my $filename = $self->{LOCATION}; |
43
|
|
|
|
|
|
|
|
44
|
2
|
|
|
2
|
1
|
4
|
return -r $filename; |
45
|
|
|
|
|
|
|
} |
46
|
2
|
|
|
|
|
3
|
no Moose; |
47
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
48
|
2
|
|
|
|
|
36
|
|
49
|
|
|
|
|
|
|
1; |
50
|
1
|
|
|
1
|
|
6895
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
51
|
|
|
|
|
|
|
=head1 Name |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Connector::Builtin::File::Simple |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 Description |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Return the contents of the file given by the LOCATION parameter. |
58
|
|
|
|
|
|
|
The path argument is discarded. |