writeToFileAndCleanOldVersionFiles
open fun writeToFileAndCleanOldVersionFiles(filePath: String, objectData: Array<Byte>, fileHeader: String)
It will clean all previous version of data files and then write objectData to the filePath. Some data type should be only saved with one latest version. Hence when a new version of data comes in, we should delete the old version data files if exists. Since the file name was generated based on pk value, delete files whose name starts with fileHeader will remove old version data files. For example, if fileHeader is 202_1900 and filePath is 202_1900_11 (building 202, data type 1900, version 11) then 202_1900_05 and 202_1900_07 will be deleted and 202_1900_11 will be created and filled with objectData.
Parameters
filePath
fileHeader