Package org.nuxeo.ecm.directory
Class DirectoryCSVLoader
java.lang.Object
org.nuxeo.ecm.directory.DirectoryCSVLoader
Helper to load data from a CSV file.
The actual consumer of rows is a parameter passed by the caller.
- Since:
- 8.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe special CSV value ("__NULL__") used to denote that anullshould be used for a value. -
Method Summary
Modifier and TypeMethodDescriptionprotected static BlobcreateBlob(String dataFileName) protected static Objectprotected static InputStreamgetResource(String name) static voidLoads the CSV data file based on the provided schema, and creates the corresponding entries using the provided loader.static voidLoads the CSV data file based on the provided schema, and creates the corresponding entries using the provided loader.protected static InputStreamGets theInputStreamfrom aURL, avoiding JAR caches.protected static BiConsumer<Map<String, Object>, Integer> toLoaderEnrichedOnError(Consumer<Map<String, Object>> loader)
-
Field Details
-
CSV_NULL_MARKER
The special CSV value ("__NULL__") used to denote that anullshould be used for a value.- See Also:
-
-
Method Details
-
loadData
public static void loadData(String dataFileName, char delimiter, Schema schema, Consumer<Map<String, Object>> loader) Loads the CSV data file based on the provided schema, and creates the corresponding entries using the provided loader.- Parameters:
dataFileName- the file name containing CSV datadelimiter- the CSV column separatorschema- the data schemaloader- the actual consumer of loaded rows- Since:
- 8.4
- See Also:
-
createBlob
-
loadData
public static void loadData(Blob dataBlob, char delimiter, Schema schema, Consumer<Map<String, Object>> loader) Loads the CSV data file based on the provided schema, and creates the corresponding entries using the provided loader.- Parameters:
dataBlob- the blob containing CSV datadelimiter- the CSV column separatorschema- the data schemaloader- the actual consumer of loaded rows- Since:
- 11.1
-
toLoaderEnrichedOnError
-
decode
-
getResource
-
open
Gets theInputStreamfrom aURL, avoiding JAR caches.- Since:
- 11.1
-