Method: App42::Util#throwExceptionIfNotValidExtension

Defined in:
lib/util/util.rb

#throwExceptionIfNotValidExtension(fileName, name) ⇒ Object

An exception to check if the file has valid extension or not

Parameters:

  • fileName
  • name


198
199
200
201
202
203
204
205
# File 'lib/util/util.rb', line 198

def throwExceptionIfNotValidExtension(fileName, name)
  if(fileName==nil)
    raise App42Exception.new(name + " parameter can not be null")
  end
  if(fileName.index('.') == -1)
    raise App42Exception.new(name + " does not contain valid extension. ")
  end
end