def getStream(self):
        """Gets the resource as stream.

        @see: L{IApplicationResource.getStream}
        """
        try:
            ds = DownloadStream(file(self._sourceFile, 'rb'),
                                self.getMIMEType(),
                                self.getFilename())
            length = str( getsize(self._sourceFile) )
            ds.setParameter('Content-Length', length)
            ds.setCacheTime(self._cacheTime)
            return ds
        except __HOLE__:
            # Log the exception using the application error handler
            class Error(IErrorEvent):

                def getThrowable(self):
                    return self.e

            self.getApplication().getErrorHandler().terminalError( Error() )
            return None
dataset/ETHPy150Open rwl/muntjac/muntjac/terminal/file_resource.py/FileResource.getStream