line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::SecurityCenter::API::File; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
910
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
69
|
|
4
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
38
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
10
|
use Carp; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
122
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
13
|
use parent 'Net::SecurityCenter::Base'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
11
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
145
|
use Net::SecurityCenter::Utils qw(:all); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
741
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.300'; |
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__ |