Library File System Data Source
A library data source that indexes all documents in a specified directory. This class will automatically add and remove files from the library based on changes in the directory.
Constructors
Properties
Allowed file extensions for indexing. Defaults to just contain only "pdf". Note, at the time of release, this is only tested with PDF files. You might have PDF files without proper extension, in which case you can set this to null or an empty set.
Specifies whether the data source should only act on changes that are explicitly provided to it, rather than having reindex the whole directory. Set this property to true if you are able to specify which changes took place in the documents directory, thus avoiding the overhead of rescanning the directory when indexing. Use with didAddOrModifyDocumentAtPath and didRemoveDocumentAtPath methods. You still need to index the library afterwards with PdfLibrary.updateIndexFromDataSource.
Functions
Notifies the data source that a document was added or modified to the documents directory. If the file does not exist in the documents directory, then this method does nothing.
Notifies the data source that a document was removed from the documents directory.
Asks the data source for a document source with the specified UID.
Returns a descriptor with some metadata for the document UID, if it has been requested for indexing.
Called after the library indexes a document.
Called after the library removes a document from its index.
Notifies the data source that the library is about to begin the indexing process. Perform any required setup here.
Asks the data source for the UIDs of the documents to be indexed by the library. This method should not return any UIDs that are already indexed, or they will be reindexed. This is useful in cases when the document was modified, and its contents changed and therefore need the index to be updated as well.
Asks the data source for the UIDs for documents to be removed. This method will be called by the library at the start of its indexing process to allow for removal of any non-existing documents.