Implement in Delphi 2010 (or compatible) the following two threaded classes:
* This class will receive as an input a directory path (e.g. 'c:\', or 'd:\stuff\'), from this directory path, including its sub-directories, the thread will iterate all the files and return to the main program thread (i.e. the piece of code that called the thread) a TStringList with all the file extensions. The result list must not contain duplicate lines. An example of a result list could be:
The class must contain a method of aborting the iteration from the main program thread, for example, a Kill() method, which would without any further delay stop the directory structure iteration and return the result list.
* This class will receive as an input two TStringLists: 1) VerifyExtList and 2) VerifyAttribList.
The VerifyExtList input string list contains a list of filenames and paths. The class will go through the VerifyExtList string list and verifies the given file or directory exists, if it doesn't exist, it is created. An example VerifyExtList could be:
c:\qwerty\[url removed, login to view]
Note: If the input list line is a filename, it is possible that the directory of the filename doesn't exist either, in such case it must be created. For example, if the line is "c:\qwerty\[url removed, login to view]" and the file doesn't exist, the code must first check if "c:\qwerty" directory exists, if it doesn't, it is created, and after that an empty "[url removed, login to view]" is created to the directory.
After VerifyExtList has been gone through, the class will go through the VerifyAttribList. It too contains a list of filenames and paths. The given filenames and paths may or may not exist. If the input line is a filename, the class will verify that the file doesn't have the ReadOnly attribute set. If it is set, the attribute is removed. If the input line is a directory path, the class will check that all the files in this directory (not the sub-directories) do not have the ReadOnly attribute set. If any such file is found, the attribute is removed.
The class must provide a mechanism for the main program thread to wait for the thread's completion. For example, the main program thread could do While [url removed, login to view]() do [url removed, login to view]; which would break when the thread has processed both the input lists.
Note: It is possible that either of the input lists contains filenames or paths that point to a disk drive that cannot be modified (e.g. a cd-rom) and thus the content cannot be changed (e.g. it's not possible to create a new directory to a cd-rom). In such case, the class must simply proceed to the next line of the input list without raising an exception and without Windows showing any error messages.