Operation: Exists
The Exists operation checks whether the files or folders defined in the path parameter exist. Outputs an XML with metadata as a result.
Status values
| The adapter operation was executed successfully. |
| The file or folder does not exist. |
Examples
The following example shows a sample parameterization of the adapter for the Exist operation to check whether the target file defined in path parameter exists.
Parameters | Value |
|---|---|
path | C:\MyFolder\File.xml |
Output
If the file does not exist:
<?xml version="1.0" encoding="UTF-8"?>
<Error>java.nio.file.NoSuchFileException: C:\MyFolder\File.xml</Error>
If the file exists:
<?xml version="1.0" encoding="UTF-8"?>
<Entry isDirectory="false" name="File.xml">
<CreationDate>2021-06-18T08:59:20.910681Z</CreationDate>
<LastModified>2021-06-18T08:22:59.284859Z</LastModified>
</Entry>
When checking if a folder exists, the attribute isDirectory="true" is set.