예제 #1
0
 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)
예제 #2
0
  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")
예제 #3
0
 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)