Syncing content from custom simple sync provider to file sync provider - Issues for binary files RRS feed

  • Question

  • Hello,

    I'm currently writing a custom sync provider (derived from FullEnumerationSimpleSyncProvider) to sync a content management system (i.e. a file storage) with the local file system. The API that I can use to access files on the content management system doesn't give me stream access. I can enumerate the content, retrieve information about versions etc. but to get access to the actual file I have to download it.

    Syncing from local file system to the content management system works fine so far but I'm having issues with syncing from remote (content management system) to local.

    In my implementation of the IFileDataRetriever interface I did the following so far:

    - for AbsoluteSourceFilePath I as throwing a NotImplementedException

    - for RelativeDirectory I return the relative path in terms of the content management system (note: has forward slashes! - do I need to transform them to backslashes?)

    - for FileStream I actually download the file from the content management system to a temp folder and return the stream to the temp file

    That seems to work for most file types but I for some file types I get a NotImplementedException and the sync is skipped. Examples for file types are: *.dll, *.pdb etc. (for test purposes I just synced a VisualStudio project to the content management system which I now try to sync back to the local system).

    In an attempt to fix this I made the following change:

    - for AbsoluteSourceFilePath I'm also downloading the file and return the full path to the temp file

    - all other methods remain as above

    This still works for most of the files (*.cs, *.resx etc) but I still get errors for the binary files - this time it's: "The system cannot find the path specified (Exception from HRESULT: 0x80070003)"

    Is there some special handling in the file sync provider for particular file types? Is there anything I can do to avoid this? To which file types does this apply?



    Thursday, November 22, 2012 3:40 PM