def GetBlobWithOffset(self, offset, timestamp=None): args = vfs_pb2.ApiGetFileBlobArgs(client_id=self.client_id, file_path=self.path, offset=offset) if timestamp: args.timestamp = timestamp return self._context.SendStreamingRequest("GetFileBlob", args)
def testCorrectlyCallsStreamingMethod(self): client_id = self.SetupClients(1)[0] fixture_test_lib.ClientFixture(client_id, self.token) args = vfs_pb2.ApiGetFileBlobArgs( client_id=client_id.Basename(), file_path="fs/tsk/c/bin/rbash") out = io.BytesIO() self.connector.SendStreamingRequest("GetFileBlob", args).WriteToStream(out) self.assertEqual(out.getvalue(), "Hello world")
def GetBlob( self, timestamp: Optional[int] = None, ) -> utils.BinaryChunkIterator: args = vfs_pb2.ApiGetFileBlobArgs( client_id=self.client_id, file_path=self.path) if timestamp is not None: args.timestamp = timestamp return self._context.SendStreamingRequest("GetFileBlob", args)