Hi everyone, whether someone has a solution for deletion downloaded file that has the same text in name and format, but always different number that is generated dynamically in name, for example “example -12.pdf”. So “12” is generated dynamically. And it can be any number, but text “example” is always the same.
It works only for static name files:
String filePath = RunConfiguration.getProjectDir() + ‘/Data Files/’
String path = filePath + importfilename
File file = new File(path)
System.out.println(‘No such File/Directory Exists’)
System.out.println(‘Directory is not Empty.’)
System.out.println(‘File Deletion is Successful.’)