line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::FSP::Entry; |
2
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
17
|
|
4
|
1
|
|
|
1
|
|
4
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
85
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use overload q{""} => sub { |
7
|
0
|
|
|
0
|
|
0
|
return $_[0]->short_name; |
8
|
1
|
|
|
1
|
|
939
|
}; |
|
1
|
|
|
|
|
732
|
|
|
1
|
|
|
|
|
7
|
|
9
|
|
|
|
|
|
|
our $VERSION = $Net::FSP::VERSION; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
0
|
|
|
0
|
1
|
|
my ($class, $fsp, $name, %attributes) = @_; |
13
|
0
|
|
|
|
|
|
$name =~ s{ \A / }{}mx; |
14
|
0
|
|
|
|
|
|
return bless { |
15
|
|
|
|
|
|
|
fsp => $fsp, |
16
|
|
|
|
|
|
|
name => $name, |
17
|
|
|
|
|
|
|
%attributes, |
18
|
|
|
|
|
|
|
}, $class; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
for my $subname (qw/name type size time link/) { |
22
|
1
|
|
|
1
|
|
113
|
no strict 'refs'; ##no critic strict |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
164
|
|
23
|
|
|
|
|
|
|
*{$subname} = sub { |
24
|
0
|
|
|
0
|
|
|
return $_[0]{$subname}; |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub move { |
29
|
0
|
|
|
0
|
1
|
|
my ($self, $new_name) = @_; |
30
|
0
|
|
|
|
|
|
$self->{fsp}->move_file($self->{name}, $new_name); |
31
|
0
|
|
|
|
|
|
return; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub short_name { |
35
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
36
|
0
|
0
|
|
|
|
|
$self->{name} =~ / ( [^\/]* ) \z /mx or croak "Couldn't determine short_name"; |
37
|
0
|
|
|
|
|
|
return $1; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub accept; |
41
|
|
|
|
|
|
|
sub remove; |
42
|
|
|
|
|
|
|
sub download; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |