public final class FileToRecordConverter
extends java.lang.Object
| Constructor and Description |
|---|
FileToRecordConverter(DataFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttachment(Record record,
java.lang.String pathAttribute,
java.lang.String attachmentName)
Add the content attachment to the given record.
|
Record |
dirToRecord(java.nio.file.Path directory,
java.lang.String dataSource)
Create a Record for the given directory and dataSource and fill it with ImportingConstants.ROOT_FOLDER_ATTRIBUTE.
|
Record |
fileToRecord(java.nio.file.Path file,
java.lang.String dataSource,
boolean withContent)
Create a Record for the given file and dataSource and fill it with all file properties.
|
public FileToRecordConverter(DataFactory factory)
public Record fileToRecord(java.nio.file.Path file, java.lang.String dataSource, boolean withContent) throws java.io.IOException
file - dataSource - withContent - if true fill also content attachment, otherwise notjava.io.IOExceptionpublic Record dirToRecord(java.nio.file.Path directory, java.lang.String dataSource) throws java.io.IOException
directory - dataSource - java.io.IOExceptionpublic void addAttachment(Record record, java.lang.String pathAttribute, java.lang.String attachmentName) throws java.io.IOException
record - pathAttribute - name of the attribute containing the path to the fileattachmentName - name with which the attachment is stored in the recordjava.io.IOException