blob: 0a5c3f8916524b346eabaf306f7a3f123ff64cf6 [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></meta><title>FetchFile</title><link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"></link></head><script type="text/javascript">window.onload = function(){if(self==top) { document.getElementById('nameHeader').style.display = "inherit"; } }</script><body><h1 id="nameHeader" style="display: none;">FetchFile</h1><h2>Description: </h2><p>Reads the contents of a file from disk and streams it into the contents of an incoming FlowFile. Once this is done, the file is optionally moved elsewhere or deleted to help keep the file system organized.</p><h3>Tags: </h3><p>local, files, filesystem, ingest, ingress, get, source, input, fetch</p><h3>Properties: </h3><p>In the list below, the names of required properties appear in <strong>bold</strong>. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the <a href="../../../../../html/expression-language-guide.html">NiFi Expression Language</a>.</p><table id="properties"><tr><th>Display Name</th><th>API Name</th><th>Default Value</th><th>Allowable Values</th><th>Description</th></tr><tr><td id="name"><strong>File to Fetch</strong></td><td>File to Fetch</td><td id="default-value">${absolute.path}/${filename}</td><td id="allowable-values"></td><td id="description">The fully-qualified filename of the file to fetch from the file system<br/><strong>Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)</strong></td></tr><tr><td id="name"><strong>Completion Strategy</strong></td><td>Completion Strategy</td><td id="default-value">None</td><td id="allowable-values"><ul><li>None <img src="../../../../../html/images/iconInfo.png" alt="Leave the file as-is" title="Leave the file as-is"></img></li><li>Move File <img src="../../../../../html/images/iconInfo.png" alt="Moves the file to the directory specified by the &lt;Move Destination Directory&gt; property" title="Moves the file to the directory specified by the &lt;Move Destination Directory&gt; property"></img></li><li>Delete File <img src="../../../../../html/images/iconInfo.png" alt="Deletes the original file from the file system" title="Deletes the original file from the file system"></img></li></ul></td><td id="description">Specifies what to do with the original file on the file system once it has been pulled into NiFi</td></tr><tr><td id="name">Move Destination Directory</td><td>Move Destination Directory</td><td></td><td id="allowable-values"></td><td id="description">The directory to the move the original file to once it has been fetched from the file system. This property is ignored unless the Completion Strategy is set to "Move File". If the directory does not exist, it will be created.<br/><strong>Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)</strong></td></tr><tr><td id="name"><strong>Move Conflict Strategy</strong></td><td>Move Conflict Strategy</td><td id="default-value">Rename</td><td id="allowable-values"><ul><li>Rename <img src="../../../../../html/images/iconInfo.png" alt="The existing destination file should remain intact. The newly ingested file should be moved to the destination directory but be renamed to a random filename" title="The existing destination file should remain intact. The newly ingested file should be moved to the destination directory but be renamed to a random filename"></img></li><li>Replace File <img src="../../../../../html/images/iconInfo.png" alt="The newly ingested file should replace the existing file in the Destination Directory" title="The newly ingested file should replace the existing file in the Destination Directory"></img></li><li>Keep Existing <img src="../../../../../html/images/iconInfo.png" alt="The existing file should in the Destination Directory should stay intact and the newly ingested file should be deleted" title="The existing file should in the Destination Directory should stay intact and the newly ingested file should be deleted"></img></li><li>Fail <img src="../../../../../html/images/iconInfo.png" alt="The existing destination file should remain intact and the incoming FlowFile should be routed to failure" title="The existing destination file should remain intact and the incoming FlowFile should be routed to failure"></img></li></ul></td><td id="description">If Completion Strategy is set to Move File and a file already exists in the destination directory with the same name, this property specifies how that naming conflict should be resolved</td></tr><tr><td id="name"><strong>Log level when file not found</strong></td><td>Log level when file not found</td><td id="default-value">ERROR</td><td id="allowable-values"><ul><li>TRACE</li><li>DEBUG</li><li>INFO</li><li>WARN</li><li>ERROR</li><li>FATAL</li><li>NONE</li></ul></td><td id="description">Log level to use in case the file does not exist when the processor is triggered</td></tr><tr><td id="name"><strong>Log level when permission denied</strong></td><td>Log level when permission denied</td><td id="default-value">ERROR</td><td id="allowable-values"><ul><li>TRACE</li><li>DEBUG</li><li>INFO</li><li>WARN</li><li>ERROR</li><li>FATAL</li><li>NONE</li></ul></td><td id="description">Log level to use in case user dhandermann does not have sufficient permissions to read the file</td></tr></table><h3>Relationships: </h3><table id="relationships"><tr><th>Name</th><th>Description</th></tr><tr><td>success</td><td>Any FlowFile that is successfully fetched from the file system will be transferred to this Relationship.</td></tr><tr><td>not.found</td><td>Any FlowFile that could not be fetched from the file system because the file could not be found will be transferred to this Relationship.</td></tr><tr><td>permission.denied</td><td>Any FlowFile that could not be fetched from the file system due to the user running NiFi not having sufficient permissions will be transferred to this Relationship.</td></tr><tr><td>failure</td><td>Any FlowFile that could not be fetched from the file system for any reason other than insufficient permissions or the file not existing will be transferred to this Relationship.</td></tr></table><h3>Reads Attributes: </h3>None specified.<h3>Writes Attributes: </h3>None specified.<h3>State management: </h3>This component does not store state.<h3>Restricted: </h3><table id="restrictions"><tr><th>Required Permission</th><th>Explanation</th></tr><tr><td>read filesystem</td><td>Provides operator the ability to read from any file that NiFi has access to.</td></tr><tr><td>write filesystem</td><td>Provides operator the ability to delete any file that NiFi has access to.</td></tr></table><h3>Input requirement: </h3>This component requires an incoming relationship.<h3>System Resource Considerations:</h3>None specified.<h3>See Also:</h3><p><a href="../org.apache.nifi.processors.standard.GetFile/index.html">GetFile</a>, <a href="../org.apache.nifi.processors.standard.PutFile/index.html">PutFile</a>, <a href="../org.apache.nifi.processors.standard.ListFile/index.html">ListFile</a></p></body></html>