Class: Baykit::BayServer::Docker::SendFile::FileContentHandler
- Inherits:
-
Object
- Object
- Baykit::BayServer::Docker::SendFile::FileContentHandler
- Includes:
- Tours, Tours::ReqContentHandler
- Defined in:
- lib/baykit/bayserver/docker/send_file/file_content_handler.rb
Constant Summary
Constants included from Tours::ReqContentHandler
Tours::ReqContentHandler::DEV_NULL
Instance Attribute Summary collapse
-
#abortable ⇒ Object
readonly
Returns the value of attribute abortable.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path) ⇒ FileContentHandler
constructor
A new instance of FileContentHandler.
- #on_abort(tur) ⇒ Object
- #on_end_content(tur) ⇒ Object
-
#on_read_content(tur, buf, start, len) ⇒ Object
Implements ReqContentHandler.
Constructor Details
#initialize(path) ⇒ FileContentHandler
Returns a new instance of FileContentHandler.
15 16 17 18 |
# File 'lib/baykit/bayserver/docker/send_file/file_content_handler.rb', line 15 def initialize(path) @path = path @abortable = true end |
Instance Attribute Details
#abortable ⇒ Object (readonly)
Returns the value of attribute abortable.
13 14 15 |
# File 'lib/baykit/bayserver/docker/send_file/file_content_handler.rb', line 13 def abortable @abortable end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
12 13 14 |
# File 'lib/baykit/bayserver/docker/send_file/file_content_handler.rb', line 12 def path @path end |
Instance Method Details
#on_abort(tur) ⇒ Object
34 35 36 37 |
# File 'lib/baykit/bayserver/docker/send_file/file_content_handler.rb', line 34 def on_abort(tur) BayLog.debug("%s onAbortReq aborted=%s", tur, abortable) return abortable end |
#on_end_content(tur) ⇒ Object
28 29 30 31 32 |
# File 'lib/baykit/bayserver/docker/send_file/file_content_handler.rb', line 28 def on_end_content(tur) BayLog.debug("%s endReqContent", tur) tur.res.send_file(Tour::TOUR_ID_NOCHECK, path, tur.res.charset, true) @abortable = false end |