51 #define BES_STREAM_BUFFER_SIZE 4096 89 string err = (string)
"Unable to stream file: " 90 +
"no container specified" ;
96 string filename = container->
access() ;
97 if( filename.empty() )
99 string err = (string)
"Unable to stream file: " 100 +
"filename not specified" ;
106 os.open( filename.c_str(), ios::in ) ;
107 int myerrno = errno ;
110 string serr = (string)
"Unable to stream file: " 111 +
"cannot open file " 113 char *err = strerror( myerrno ) ;
117 serr +=
"Unknown error" ;
124 os.read( block,
sizeof block ) ;
125 nbytes = os.gcount() ;
130 os.read( block,
sizeof block ) ;
131 nbytes = os.gcount() ;
161 << (
void *)
this <<
")" << endl ;
error thrown if the resource requested cannot be found
exception thrown if inernal error encountered
static BESResponseHandler * BESStreamResponseBuilder(const string &name)
list< BESContainer * > containers
ostream & get_output_stream()
virtual void execute(BESDataHandlerInterface &r)
executes the command 'get file <filename>;' by streaming the specified file
BESResponseObject * _response
virtual string access()=0
returns the true name of this container
virtual void dump(ostream &strm) const
dumps information about this object
handler object that knows how to create a specific response object
virtual void transmit(BESTransmitter *transmitter, BESDataHandlerInterface &r)
transmit the file, streaming it back to the client
static ostream & LMarg(ostream &strm)
virtual ~BESStreamResponseHandler(void)
Structure storing information used by the BES to handle the request.
virtual void dump(ostream &strm) const
dumps information about this object
void first_container()
set the container pointer to the first container in the containers list
A container is something that holds data.
#define BES_STREAM_BUFFER_SIZE
BESContainer * container
pointer to current container in this interface
BESStreamResponseHandler(const string &name)