FF-1539: Directory Iterator

This commit is contained in:
John Andrews
2024-05-11 09:11:37 +12:00
parent 349eabf48e
commit 7430fc45e5
5 changed files with 23 additions and 30 deletions

View File

@@ -1,7 +1,8 @@
using FileFlows.Plugin;
using FileFlows.Plugin.Attributes;
using System.ComponentModel.DataAnnotations;
namespace FileFlows.SiteScraping;
namespace FileFlows.BasicNodes.Functions;
/// <summary>
/// A special flow element that iterates all files in a directory and process them through a sub flow
/// </summary>
@@ -12,7 +13,7 @@ public class DirectoryIterator : Node
/// <inheritdoc />
public override int Outputs => 1;
/// <inheritdoc />
public override FlowElementType Type => FlowElementType.Logic;
public override FlowElementType Type => FlowElementType.SubFlow;
/// <inheritdoc />
public override string HelpUrl => "https://fileflows.com/docs/plugins/basic-nodes/directory-iterator";
/// <inheritdoc />
@@ -41,7 +42,7 @@ public class DirectoryIterator : Node
/// Gets or sets if all files or just the top directory files should be iterated over
/// </summary>
[Boolean(4)]
public bool AllFiles { get; set; }
public bool Recursive { get; set; }
/// <inheritdoc />
public override int Execute(NodeParameters args)

View File

@@ -366,18 +366,6 @@
"File-Help": "Der Name der zu entpackenden Datei. Kann leer gelassen werden. In diesem Fall wird der Name der zu entpackenden Datei verwendet."
}
},
"Unzip": {
"Description": "Ermöglicht das Entpacken einer Datei",
"Outputs": {
"1": "Datei entpackt"
},
"Fields": {
"DestinationPath": "Zielordner",
"DestinationPath-Help": "Der Zielordner, in den die ZIP-Datei entpackt werden soll.",
"Zip": "Zip File",
"Zip-Help": "The filename of the zip to extract. Can be left blank and if so the current working file will be used."
}
},
"Zip": {
"Description": "Ermöglicht Ihnen, die Datei zu komprimieren",
"Outputs": {

View File

@@ -125,11 +125,27 @@
"FileName-Help": "A path to either a file or folder to delete.\n\nIf left blank the current working file will be deleted."
}
},
"DirectoryIterator": {
"Description": "Iterates all files in a given directory and executes those files against a sub flow.",
"Outputs": {
"1": "Directory files iterated"
},
"Fields": {
"FileName": "Path",
"FileName-Help": "A path to either a file or folder to delete.\n\nIf left blank the current working file will be deleted."
}
},
"FailFlow": {
"Description": "Fails a flow immediately, useful if you want a certain path to just fail.",
"Fields": {
"Reason": "Reason",
"Reason-Help": "An optional reason to log why this flow is failing."
"Flow": "Flow",
"Flow-Help": "The sub flow to execute the files against.",
"Directory": "Directory",
"Directory-Help": "The directory whose files will be iterated.",
"Pattern": "Pattern",
"Pattern-Help": "Any optional pattern to limit the files for iteration, this can be a wildcard pattern starting with a `*` or a regular expression.",
"Recursive": "Recursive",
"Recursive-Help": "If files in all sub directories should also be iterated, or if only the top level files should be iterated."
}
},
"FileSize": {
@@ -406,18 +422,6 @@
"File-Help": "The name of the file to unpack. Can be left blank and if so the current working file will be used."
}
},
"Unzip": {
"Description": "Allows you to unzip a file",
"Outputs": {
"1": "File Unzipped"
},
"Fields": {
"DestinationPath": "Destination Folder",
"DestinationPath-Help": "The destination folder where to extract the zip file.",
"Zip": "Zip File",
"Zip-Help": "The filename of the zip to extract. Can be left blank and if so the current working file will be used."
}
},
"Zip": {
"Description": "Allows you to zip the input",
"Outputs": {

Binary file not shown.

Binary file not shown.