mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2025-12-31 12:19:48 -06:00
32 lines
959 B
C#
32 lines
959 B
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 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;
|
|
}
|
|
}
|
|
}
|
|
} |