Files
FileFlowsPlugins/BasicNodes/File/InputFile.cs
John Andrews 211d998fe4 docs
2022-07-09 00:39:32 +12:00

34 lines
1.0 KiB
C#

namespace FileFlows.BasicNodes.File
{
using System.ComponentModel;
using FileFlows.Plugin;
using FileFlows.Plugin.Attributes;
public class InputFile : Node
{
public override int Outputs => 1;
public override FlowElementType Type => FlowElementType.Input;
public override string Icon => "far fa-file";
public override string HelpUrl => "https://docs.fileflows.com/plugins/basic-nodes/input-file";
public override int Execute(NodeParameters args)
{
try
{
FileInfo fileInfo = new FileInfo(args.WorkingFile);
if (fileInfo.Exists == false)
{
args.Logger?.ELog("File not found: " + args.WorkingFile);
return -1;
}
return 1;
}
catch (Exception ex)
{
args.Logger?.ELog("Failed in InputFile: " + ex.Message + Environment.NewLine + ex.StackTrace);
return -1;
}
}
}
}