Class: AbstractProviderBySyncDirectory

AbstractProviderBySyncDirectory

new AbstractProviderBySyncDirectory(directory, options)

Provides an item by loading all of the files in a directory Items are loaded synchronously. This object should only be used to load files that must be processed immediately as it will block execution until all the files in the directory have been processed.
Parameters:
Name Type Description
directory String The directory to read from
options Object.<String, Object> Options for configuration. This can also be used as a map to pass to the ItemProcessor if the implementing class wants to pass information into the ItemProcessor method
Properties
Name Type Attributes Default Description
filenameFormatter FilenameFormatter <optional>
DefaultJSFilenameFormatter The FilenameFormmatter to use to parse the filenames to determine item file name as well as how to format the itemId to become a filename. This object will only load files that match the formatters isValid() method
fileEncoding String <optional>
utf8 The file encoding to use when reading files and directories
itemMap Object.<String, Object> <optional>
A map that may be passed in to prime the internal map with.
Implements:
Source:

Methods

getItem(itemId) → {Object}

Returns the item stored under the itemId. May be null
Parameters:
Name Type Description
itemId String The Id of the item to return
Implements:
Source:
Returns:
The item corresponding to the itemId
Type
Object

(abstract) processItem(items, itemId, fileName, options)

Processes the specific item and returns the result
Parameters:
Name Type Description
items Map Map of the items being processed
itemId String The Id of the item to process
fileName String The name of the file being processed
options Object Any options that are being passed to the ItemProcessor (can be null)
Implements:
Source:

(abstract) processItems(items, fileName, options)

Processes multiple items at once
Parameters:
Name Type Description
items Map Map of the items being processed
fileName String The name of the file being processed
options Object Any options that are being passed to the ItemProcessor (can be null)
Implements:
Source: