Class: RestFtpDaemon::Remote::RemoteBase
- Inherits:
-
Object
- Object
- RestFtpDaemon::Remote::RemoteBase
show all
- Includes:
- BmcDaemonLib::LoggerHelper, CommonHelpers
- Defined in:
- lib/rest-ftp-daemon/remote/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#dashboard_url, #exception_to_error, #format_bytes, #identifier, #underscore
Constructor Details
#initialize(target, context, debug = false, ftpes = false) ⇒ RemoteBase
Returns a new instance of RemoteBase.
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/rest-ftp-daemon/remote/base.rb', line 16
def initialize target, context, debug = false, ftpes = false
@target = target
@ftpes = ftpes
@debug = !!debug
@job = Job.new(nil, {})
@context = context || {}
log_pipe :transfer
log_info "initialize debug[#{debug}] target[#{target.path}] "
prepare
end
|
Instance Attribute Details
#job ⇒ Object
Returns the value of attribute job.
10
11
12
|
# File 'lib/rest-ftp-daemon/remote/base.rb', line 10
def job
@job
end
|
#log_prefix ⇒ Object
9
10
11
|
# File 'lib/rest-ftp-daemon/remote/base.rb', line 9
def log_prefix
@log_prefix
end
|
Instance Method Details
#chdir_or_create(directory, mkdir = false) ⇒ Object
55
56
|
# File 'lib/rest-ftp-daemon/remote/base.rb', line 55
def chdir_or_create directory, mkdir = false
end
|
#close ⇒ Object
61
62
63
64
65
66
67
|
# File 'lib/rest-ftp-daemon/remote/base.rb', line 61
def close
log_debug "close"
return unless @debug
puts "-------------------- SESSION CLOSING --------------------------"
end
|
#connect ⇒ Object
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/rest-ftp-daemon/remote/base.rb', line 43
def connect
return unless @debug
puts
puts "-------------------- SESSION STARTING -------------------------"
puts "class\t #{myname}"
puts "host\t #{@target.host}"
puts "user\t #{@target.user}"
puts "port\t #{@target.port}"
puts "---------------------------------------------------------------"
end
|
#prepare ⇒ Object
40
41
|
# File 'lib/rest-ftp-daemon/remote/base.rb', line 40
def prepare
end
|
#remove!(target) ⇒ Object
58
59
|
# File 'lib/rest-ftp-daemon/remote/base.rb', line 58
def remove! target
end
|
#size_if_exists(target) ⇒ Object
36
37
38
|
# File 'lib/rest-ftp-daemon/remote/base.rb', line 36
def size_if_exists target
false
end
|