Skip to content

source.getFileDirectory

Signature: source.getFileDirectory()

Returns: String fileDirectory - the source-relative directory path associated with the source file, or an empty string when the file is in the root

Returns the full source-relative directory path associated with the source file using / as the separator.

Note

Only applies to channels where the message source is a file.

Note

This method only applies to the following formatted messages: HL7, ASTM, Binary, CSV, DICOM, EDIFACT, Old Fxd Width, Fxd Length, ISO 8583, JSON, Text, X12, XML.

Parameters

None

Example

// Example: Retrieve the source-relative directory path of the source message.

// Get the source-relative directory path associated with the source file
var fileDirectory = source.getFileDirectory(); // e.g. "", "orders/2026/03"