You redesign your SharePoint Server 2007 solution. You write the following code segment:
01: Shared Sub folderShare(ByVal portal_uri As String, ByVal doc_uri As String, ByVal folder_location As String)
02: Dim site As SPSite = New SPSite “_uri”
03: Try
04: Dim context as ServerContext = ServerContext.getContext(“site”)
05: Dim sspContent as Content = New Content(context)
06: Try
07: Dim targetURI as URI = New URI(doc_URI)
08: Try
09: Dim sspContentSources as ContentSourceCollection = sspContent.ContentSources
10: …
11: Finally
12: CType(targetURI, iDisposable).dispose()
13: End Try
14: Finally
15: CType(sspContent, iDisposable).dispose()
16: End Try
17: Finally
18: CType(site, iDisposable).dispose()
19: End Try
20: End Sub
You need to add a folder from UNC path that contains documents as a content source.
Which code segment would you insert at line 16?
A.
…
Dim fileCS as FileShareContentSource = CType(SSPContentSource.Create(GetType(FileShareContentSources), folder_location), FileShareContentSource)
fileCS.StartAddresses.Add(targetURI)
fileCS.FollowDirectories = True
fileCS.Update
…
B.
…
Dim sharepointCS as SharePointContentSource =
CType(SSPContentSource.Create(GetType(SharePointContentSources), folder_location), SharePointContentSource)
sharepointCS.StartAddresses.Add(targetURI)
sharepointCS.SharePointCrawlBehavior=SharePointCrawlBehavior.CrawlSites sharepointCS.Update
…
C.
…
Dim fileCS as FileShareContentSource = CType(SSPContentSource.Create(GetType(FileShareContentSources), folder_location), FileShareContentSource)
fileCS.FileDirectories = True
fileCS.StartFullCrawl
…
D.
Dim contentSource as Content = new Content(SearchContext.GetContext(New SPSite(targetURI.AbsolutePath))) contentSource.ContentSources.Tag=folderLocation
contentSource.ContentSources.Update
…