I am about to define an interface in my application that plug-in writers can implement to provide user-defined "export" capabilities. It'll look something like this:
public interface IFooExporter
{
void ExportFoo(Foo foo, string path);
}
However, I need to let the plug-in writers know (explicitly, not just in documentation) that "path" represents a folder, not a filename. It's their responsibility to create the files as part of the export process.
What's the best way to enforce that a path is a folder and not a filename? My best guess right now is to use DirectoryInfo instead of string:
public interface IFooExporter
{
void ExportFoo(Foo foo, DirectoryInfo folder);
}
Is that a good solution, or are there pitfalls I'm not aware of with passing DirectoryInfo instances around?