using FileFlows.Plugin; namespace FileFlows.BasicNodes.File; /// /// Basic Input file, the default input node /// public class InputFile : Node { /// /// Gets the number of outputs /// public override int Outputs => 1; /// /// Gets the element type /// public override FlowElementType Type => FlowElementType.Input; /// /// Gets the icon /// public override string Icon => "far fa-file"; /// /// Gets the help URL /// public override string HelpUrl => "https://docs.fileflows.com/plugins/basic-nodes/input-file"; /// /// Executes the node /// /// the node parameters /// the output to call next 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; } args.Variables.Add("ORIGINAL_CREATE_UTC", fileInfo.CreationTimeUtc); args.Variables.Add("ORIGINAL_LAST_WRITE_UTC", fileInfo.LastWriteTimeUtc); return 1; } catch (Exception ex) { args.Logger?.ELog("Failed in InputFile: " + ex.Message + Environment.NewLine + ex.StackTrace); return -1; } } }