Sementic api change from v21 to v23 (load options factory)

We use the following conversion api:

var converter = new Converter(streamProvider, loadOptionsProvider, settingsProvider);

where:

Func<FileType, LoadOptions> loadOptionsProvider = (fileType) => {
  ...
};

In version 21, we used to have a valid file type in fileType argument, now in v23.8 it’s always blank (like if the file was unknown data).

We added a call to FileType.FromStream(inputStream); to detect the primary file type and use this instead of the one provided in the callback to `loadOptionsProvider[.

But is that a bug? What if the file is a container (eg. zip or msg) and we need to convert sub-documents? We rely on the file type to prepare the proper load options.

@talaw

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CONVERSIONNET-6329

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@talaw

This callback is called many times, depending on the detected source document stream file type. Please check the fileType argument and return a corresponding LoadOptions depending on the type. If fileType is null, then you can return null as load options value.

First time when this callback is called the fileType value is really null, because it’s not yet detected. Maybe that’s causing the confusion.

More info can be found here at load personal storage PST or OST with options.

Sample load options provider could be:

Func<FileType, LoadOptions> loadOptionsProvider = (fileType) => {
    if (fileType == EmailFileType.Ost)
    {
        return new PersonalStorageLoadOptions
        {
            Folder = "Inbox",
        };
    }
    if (fileType == EmailFileType.Msg)
    {
        return new EmailLoadOptions
        {
            ConvertOwner = true,
            ConvertOwned = true,
            Depth = 2
        };
    }
    return null;
};