require 'FileUtils' class Filesutil def findFilesByFileName(path,filename) files = Dir["#{path}/**/#{filename}"] return files end def getExpandedPathByFileName(file) return File.expand_path(file.to_s) end def removeFile(file) FileUtils.rm(getExpandedPathByFileName(file)) end def getDirectoryNameByFile(file) return File.dirname("#{file}") end def getAllFilesByPath(path) return Dir["#{path}/*.*"] end def getFileBasename(file) return File.basename(file.to_s) end end