GetFileSourceHandler
The GetFileSourceHandler method returns an implementation of the IFileSourceHandler interface, which is a utility class designed to handle files from various sources generically, regardless of their underlying type.
File sources are rooted at the location specified by the file source path, e.g., C:\Bob\ or Azure:\Bob\, both of which start in the Bob folder. You do not need to specify the folder in the methods below, as it is assumed that Bob is the root location.
If you want to target a folder below Bob, such as C:\Bob\AnotherFolder or Azure:\Bob\AnotherFolder, you can use the AdditionalPath parameter to change the root to that location.
IFileSourceHandler provides the following methods:
Reads a file from the file source and returns a byte array with the data.
Reads a file from the file source and returns a string array, where each element represents a line from the file.
Uploads a file to the file source with the provided filename and byte array of data.
Set overwrite to true to allow overwriting any existing file. Set retryWithDiffName to true to enable appending numbers to the filename if it already exists.
Deletes a file from the file source.
Searches for files in the file source that match the given pattern (e.g., *.csv will find all CSV files).
Moves a file from one location to another. If the file exists at the target location, numbers will be appended to the filename until a free name is found.