#NEWLINE# def ScanForStorageMediaImage( self , source_path_spec ) : #NEWLINE# #INDENT# 'Scans the path specification for a supported storage media image format.\n\n    Args:\n      source_path_spec: the source path specification (instance of\n                        dfvfs.PathSpec).\n\n    Returns:\n      The storage media image path specification (instance of dfvfs.PathSpec)\n      or None if no supported storage media image type was found.\n\n    Raises:\n      BackEndError: if the source cannot be scanned or more than one storage\n                    media image type is found.\n    ' #NEWLINE# try : #NEWLINE# #INDENT# type_indicators = analyzer . Analyzer . GetStorageMediaImageTypeIndicators ( source_path_spec , resolver_context = self . _resolver_context ) #NEWLINE# #UNINDENT# except RuntimeError as exception : #NEWLINE# #INDENT# raise errors . BackEndError ( 'Unable to process source path specification with error: {0:s}' . format ( exception ) ) #NEWLINE# #UNINDENT# if ( not type_indicators ) : #NEWLINE# #INDENT# file_system = resolver . Resolver . OpenFileSystem ( source_path_spec , resolver_context = self . _resolver_context ) #NEWLINE# raw_path_spec = path_spec_factory . Factory . NewPathSpec ( definitions . TYPE_INDICATOR_RAW , parent = source_path_spec ) #NEWLINE# try : #NEWLINE# #INDENT# glob_results = raw . RawGlobPathSpec ( file_system , raw_path_spec ) #NEWLINE# #UNINDENT# except errors . PathSpecError : #NEWLINE# #INDENT# glob_results = None #NEWLINE# #UNINDENT# if ( not glob_results ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# return raw_path_spec #NEWLINE# #UNINDENT# if ( len ( type_indicators ) > 1 ) : #NEWLINE# #INDENT# raise errors . BackEndError ( 'Unsupported source found more than one storage media image types.' ) #NEWLINE# #UNINDENT# return path_spec_factory . Factory . NewPathSpec ( type_indicators [ 0 ] , parent = source_path_spec )