def CollectionItemToAff4Path(item):
 if isinstance(item, rdf_flows.GrrMessage):
  item = item.payload
 if isinstance(item, rdf_client.StatEntry):
  return item.aff4path
 elif isinstance(item, rdf_file_finder.FileFinderResult):
  return item.stat_entry.aff4path
 elif isinstance(item, collectors.ArtifactFilesDownloaderResult):
  if item.HasField('downloaded_file'):
   return item.downloaded_file.aff4path
 raise ItemNotExportableError()

def CollectionItemToAff4Path ( item ) : if isinstance ( item , rdf_flows . GrrMessage ) : item = item . payload if isinstance ( item , rdf_client . StatEntry ) : return item . aff4path elif isinstance ( item , rdf_file_finder . FileFinderResult ) : return item . stat_entry . aff4path elif isinstance ( item , collectors . ArtifactFilesDownloaderResult ) : if item . HasField ( 'downloaded_file' ) : return item . downloaded_file . aff4path raise ItemNotExportableError ( )
converts given rdfvalue to an rdfurn of a file to be downloaded .