Ejemplo n.º 1
0
    def analyze_dir(self, _dir):
        """ Creates a Virus object containng all files in the specifiled directory
		and retrieves metadata from each file found.
		
		Args:
			_dir: The directory containing files to analyze.
			
		Returns:
			Virus object containing information retrieved from the data
			source.
			
		Raises:
			Exception if the provided directory is null or empty.
		
		"""
        if (_dir and len(_dir) > 0):
            self.logger.print_info(MSG_INFO_ANALYZING.format(_dir))

            vx = Virus(_logger=self.logger)
            vx.add_dir(_dir)
            self.datasource.retrieve_metadata(vx)
            return vx
        else:
            raise NullOrEmptyArgumentException()
Ejemplo n.º 2
0
	def analyze_dir(self, _dir):
		""" Creates a Virus object containng all files in the specifiled directory
		and retrieves metadata from each file found.
		
		Args:
			_dir: The directory containing files to analyze.
			
		Returns:
			Virus object containing information retrieved from the data
			source.
			
		Raises:
			Exception if the provided directory is null or empty.
		
		"""
		if (_dir and len(_dir) > 0):
			self.logger.print_info(MSG_INFO_ANALYZING.format(_dir))
			
			vx = Virus(_logger=self.logger)
			vx.add_dir(_dir)
			self.datasource.retrieve_metadata(vx)
			return vx
		else:
			raise NullOrEmptyArgumentException()