locked
SubdirectoryExcludes RRS feed

  • Question

  • Hi,

    does anyone knows, if the SubdirectoryExcludes-property of the FileSyncProvider don't work??

    First I tested it, in only the RemoteProvider(Source), then with the LocalProvider(target) too, but the dir with the files in it, are synched neverless...

    greetz bAsTi

    Thursday, August 7, 2008 2:05 PM

Answers

  •  

    FileSyncScopeFilter is used by provider to determine whether a file / subdirectory is in a sync scope. If it is defined in the filter scope, that item will not be included in the sync operation.

     

    In your sync community, in order to property filter out certain items, all providers in your community must share the same scope filter. Otherwise, the behavior may not be as desired.

     

    From your sample, it is difficult to determine whether you actually did this (i.e. I see multiple filter objects). each provider has one filesyncscope filter which includes filter definition for files, subdirectories, etc... , and this must be same definition across all providers in order to correctly exclude the items in any sync between the providers.

     

    Thanks,

     

    Patrick

    Monday, August 11, 2008 3:17 AM

All replies

  • Could you describe how you used the filter? If you could provide sample code for the section where you define the filter, it would be more helpful.

     

    Thanks,

     

    Patrick

    Thursday, August 7, 2008 6:36 PM
  •  Hi,

    this my code:


    Code Snippet
    FileSyncScopeFilter sourceFilter = new FileSyncScopeFilter();


              myFilter.FileNameExcludes.Add(syncIdFile);


                    string[] directories = DirectoriesToExclude.Split(new char[] { ';' });

                    foreach (string dir in directories)
                    {
                        destinationFilter.SubdirectoryExcludes.Add(dir);

                   }


    and after this I initialize the FileSyncProvider with the ScopeFilter. Should the Scopefilter intialized with both FileSyncProviders(Source, Destination) or is it sufficient when only the sourceProvider is initialized with the Scopfilter(with the dirs to exclude)??

    greetz bAsTi
    Friday, August 8, 2008 7:37 AM
  •  

    FileSyncScopeFilter is used by provider to determine whether a file / subdirectory is in a sync scope. If it is defined in the filter scope, that item will not be included in the sync operation.

     

    In your sync community, in order to property filter out certain items, all providers in your community must share the same scope filter. Otherwise, the behavior may not be as desired.

     

    From your sample, it is difficult to determine whether you actually did this (i.e. I see multiple filter objects). each provider has one filesyncscope filter which includes filter definition for files, subdirectories, etc... , and this must be same definition across all providers in order to correctly exclude the items in any sync between the providers.

     

    Thanks,

     

    Patrick

    Monday, August 11, 2008 3:17 AM