line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::FSP::Dir; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
20
|
|
5
|
1
|
|
|
1
|
|
4
|
use base 'Net::FSP::Entry'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
346
|
|
6
|
|
|
|
|
|
|
our $VERSION = $Net::FSP::VERSION; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub list { |
9
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
|
|
|
my $dir = $self->name; |
12
|
0
|
|
|
|
|
|
return $self->{fsp}->list_dir($self->name . '/'); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub download { |
16
|
0
|
|
|
0
|
1
|
|
my ($self, $local_dir) = @_; |
17
|
0
|
0
|
|
|
|
|
$local_dir = $self->name if not defined $local_dir; |
18
|
|
|
|
|
|
|
|
19
|
0
|
0
|
|
|
|
|
mkdir $local_dir if not -d $local_dir; |
20
|
0
|
|
|
|
|
|
for my $entry ($self->list) { |
21
|
0
|
|
|
|
|
|
$entry->download; |
22
|
|
|
|
|
|
|
} |
23
|
0
|
|
|
|
|
|
return; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub accept { |
27
|
0
|
|
|
0
|
1
|
|
my ($self, $visitor) = @_; |
28
|
0
|
|
|
|
|
|
$visitor->($self); |
29
|
0
|
|
|
|
|
|
for my $entry ($self->list) { |
30
|
0
|
|
|
|
|
|
$entry->accept($visitor); |
31
|
|
|
|
|
|
|
} |
32
|
0
|
|
|
|
|
|
return; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub change_current { |
36
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
37
|
0
|
|
|
|
|
|
$self->{fsp}->change_dir($self->{name}); |
38
|
0
|
|
|
|
|
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub remove { |
42
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
43
|
0
|
|
|
|
|
|
$self->{fsp}->remove_dir($self->{name}); |
44
|
0
|
|
|
|
|
|
return; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub readme { |
48
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
49
|
0
|
|
|
|
|
|
return $self->{fsp}->get_readme($self->{name}); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub get_protection { |
53
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
54
|
0
|
|
|
|
|
|
return $self->{fsp}->get_protection($self->{name}); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub set_protection { |
58
|
0
|
|
|
0
|
1
|
|
my ($self, $mod) = @_; |
59
|
0
|
|
|
|
|
|
return $self->{fsp}->get_protection($self->{name}); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |