Table of Contents

FileReadValve

Warning

This valve is blocking - this may hurt throughput and cause performance issues since other pipes won't be able to execute while this valve is waiting on a long-running operation in the same instance of the pipes module, for example due to a network request, disk access or similar. Try to limit the usage of blocking valves, try to ensure that they are fast to execute, and if needed, consider deploying multiple instances of the pipes module.

Note

Valve to read input from a file and add the content to a property on the current item.

Valve operates on the Current Item Set and will be executed on every item.

Configuration property content_type determines how the destination value is encoded and if content_type is text (matches content type: 'text/*'), value is stored as plain text, otherwise value is assumed binary and will be stored in base64.

File will be read using the charset specified in the charset parameter in content_type. If charset isn’t specified, the default charset will be used.

Valve operates on the Current Item Set and will process all items surviving the common item filtering rules.

Properties

Name Description Default value Mandatory Supports property expansion
path The path of the file to read. Yes Yes
dest The destination property of the current item. Yes No
content_type Content type of the input. text/plain;charset=utf-8 No No

Example Configuration

{
    "name": "FileReadValve",
    "config": { 
        "path":"C:\\Windows\\Temp\\file.txt",
        "dest":"imported_file_data",
        "content_type" : "text/plain;charset=utf-8"
    }
}

Requirements

Item set must have at least one entry.