line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::SecurityCenter::API::File; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
822
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
69
|
|
4
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
44
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
8
|
use Carp; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
124
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
13
|
use parent 'Net::SecurityCenter::Base'; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
10
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
123
|
use Net::SecurityCenter::Utils qw(:all); |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
775
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.311'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
15
|
|
|
|
|
|
|
# METHODS |
16
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub upload { |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
0
|
1
|
|
my ( $self, $file ) = @_; |
21
|
|
|
|
|
|
|
|
22
|
0
|
0
|
|
|
|
|
( @_ == 2 ) or croak( 'Usage: ' . __PACKAGE__ . '->upload( $FILE )' ); |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
my $response = $self->client->upload($file); |
25
|
|
|
|
|
|
|
|
26
|
0
|
0
|
|
|
|
|
return if ( !$response ); |
27
|
0
|
|
|
|
|
|
return $response->{filename}; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub clear { |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
0
|
1
|
|
my ( $self, $file ) = @_; |
36
|
|
|
|
|
|
|
|
37
|
0
|
0
|
|
|
|
|
( @_ == 2 ) or croak( 'Usage: ' . __PACKAGE__ . '->clear( $FILE )' ); |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
my $response = $self->client->post( '/file/clear', { filename => $file } ); |
40
|
|
|
|
|
|
|
|
41
|
0
|
0
|
|
|
|
|
return if ( !$response ); |
42
|
0
|
|
|
|
|
|
return 1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |