Table of Contents

Class FileScanOptions

Namespace
Quartz.Jobs
Assembly
Quartz.Jobs.dll

What FileScanJob watches and when it considers the file settled.

public sealed record FileScanOptions : IEquatable<FileScanOptions>
Inheritance
FileScanOptions
Implements
Inherited Members

Remarks

The job is configured through its JobDataMap, and those keys are the persisted contract — this type is the named way to write and read them. UsingFileScanOptions<TConfigurator>(TConfigurator, FileScanOptions) writes them, FromJobData(JobDataMap) reads them back, and job data written by hand or by an earlier version reads the same either way.

Properties

FileName

The file to monitor; an absolute path is recommended.

public required string FileName { get; init; }

Property Value

string

MinimumUpdateAge

How long the file must have been left alone to count as altered rather than as one another process is still writing. Defaults to five seconds.

public TimeSpan MinimumUpdateAge { get; init; }

Property Value

TimeSpan

Remarks

Persisted as a whole number of milliseconds under MinimumUpdateAge, which is what earlier versions wrote.

ScanListenerName

The SchedulerContext key an IFileScanListener is stored under.

public required string ScanListenerName { get; init; }

Property Value

string

Methods

FromJobData(JobDataMap)

Reads the options out of a job's data, taking the default for every key it does not carry.

public static FileScanOptions FromJobData(JobDataMap data)

Parameters

data JobDataMap

The job data to read, normally MergedJobDataMap.

Returns

FileScanOptions

Exceptions

JobExecutionException

FileName or FileScanListenerName is absent; the job has nothing to watch, or nothing to tell.

ToJobData()

Writes the options as the job data keys FileScanJob reads.

public JobDataMap ToJobData()

Returns

JobDataMap