Created 11-06-2017 10:30 PM
Hi All,
Thanks a lot to this awesome community.
I am trying to replicate a directory structure from where I am listing and fetching the files using list and fetchsftp
I did a PoC and I can see it stores the filename but not sure if it can store the directory structure if I give the top level direcotry to list.
Any suggestion or help
Thanks
Created 11-06-2017 11:39 PM
You can get directory structure from path attribute associated with the flow file,
path //The fully qualified name of the directory on the SFTP Server from which the file was pulled.
Filename attribute will give you the actual file name that got pulled from the directory
filename //The name of the file on the SFTP Server
in Fetchsftp processor we are going to use
${path}/${filename} //to fetch the actual file this expression will give directory and also file path.
if you give top level directory and
Recurse Subdirectories property to true the processor will navigate through all the subdirectories are in that top level directory(if nifi having access to those sub directories) and list all the files in those sub directories.
Each flowfile will have path,filename attribute as path attribute gives you from which directory the file got pulled from and filename attribute gives you actual filename of the file.
Created 11-06-2017 11:39 PM
You can get directory structure from path attribute associated with the flow file,
path //The fully qualified name of the directory on the SFTP Server from which the file was pulled.
Filename attribute will give you the actual file name that got pulled from the directory
filename //The name of the file on the SFTP Server
in Fetchsftp processor we are going to use
${path}/${filename} //to fetch the actual file this expression will give directory and also file path.
if you give top level directory and
Recurse Subdirectories property to true the processor will navigate through all the subdirectories are in that top level directory(if nifi having access to those sub directories) and list all the files in those sub directories.
Each flowfile will have path,filename attribute as path attribute gives you from which directory the file got pulled from and filename attribute gives you actual filename of the file.