Operation

Description

abstract class Tinman.Core.Threading.Operations.Operation

Derived from

Disposable abstract
IOperation

Extended by

TestOperation sealed

Abstract base class for IOperation implementations.

Public / Constructors

Checksum


[OwnerReturn]
public static method Checksum → (1)

file in : Path

[not-null]
Path to file for which to compute an MD5 checksum.

returns → IOperation

The operation.

Creates an MD5 checksum (*.md5, like Unix md5sum) for the given file.

The operation will create a new file in the same directory as file in:

some_input_file.txt -> some_input_file.md5

Copy


[OwnerReturn]
public static method Copy → (5)

source in : Path

[not-null]
The source file path.

target in : Path

[not-null]
The target path. If it has a trailing separator (see Path.IsTrailing), then the value of many opt parameter is ignored and this method behaves as if true had been passed as value.

resume opt : bool = false

Resume copy operation if target file already exists?

timestamp opt : bool = false

Update last modification timestamp after finishing each file copy?

many opt : bool = true

If true, source in may contain wildcards in its last path element (thus referring to zero or more source files) and the target in path points to a directory.
If false, source in and target in each point to a single file.

returns → IOperation

The operation.

Copies zero or more files.

Delete


[OwnerReturn]
public static method Delete → (1)

file in : Path

[not-null]
The file path. The last path element may contain wildcards.

returns → IOperation

The operation.

Deletes zero or more existing files.

Flush


[OwnerReturn]
public static method Flush → (1)

flushable in : IFlushable

[not-null]
The flushable object.

returns → IOperation

The operation.

Returns an IOperation that calls IFlushable.Flush.

Sync


[OwnerReturn]
public static method Sync → (7)

source in : Path

[not-null]
The source directory.

target in : Path

[not-null]
The target directory.

skip opt : Path [ ] = null

Optional set of paths to use for skipping existing files and directories in source in, where a skipped file or directory is treated as if it did not exist in the first place. The given paths may contain wildcards (see Path.IsWildcard). Paths without a trailing separator are matched against files, those with a trailing separator are matched against directories (see Path.IsTrailing).

keep opt : Path [ ] = null

Optional set of paths to use for keeping files and directories in source in and target in, where a kept file or directory never matches a skip opt filter and is treated as if an identical counter-part existed in source in. The given paths may contain wildcards (see Path.IsWildcard). Paths without a trailing separator are matched against files, those with a trailing separator are matched against directories (see Path.IsTrailing).

hash opt : bool = true

Use file content hashes to detect actual modifications if both file length and timestamp are not identical?

parallelism opt : int32 = 8

[>=1]
The number of threads to use for copying.

timestamp opt : int32 = 0

[>=0]
If the timestamps of two files differ by this delta in milliseconds or less, the timestamps are considered to be equivalent.

returns → IOperation

The operation.

Synchronizes the content of source in to the given target in directory, including file deletions.

The operation will perform read-only accesses on source in. The file paths given via skip opt and keep opt may be absolute or relative. In the first case, they will be ignored if they do not point into the respective root directory. In the second case, they are resolved against the respective root directory.

Public / Methods

Copy​List


public static method CopyList → (2)

source in : Path

[not-null]
The source file path.

many opt : bool = true

See Copy for details.

returns → Path [ ]

The set of source files.

Computes the set of source files that would be used by an operation created with Copy, using the same arguments.

IOException

If an I/O error has occurred.

Sync​List


public static method SyncList → (3)

source in : Path

[not-null]
The source directory.

skip opt : Path [ ] = null

Optional set of paths to use for skipping existing files and directories in source in, see Sync for details.

keep opt : Path [ ] = null

Optional set of paths to use for keeping existing files and directories in source in, see Sync for details.

returns → Path [ ]

The set of source files (without a trailing separator) and source directories (with a trailing separator), relative to source in.

Computes the set of source files that would be used by an operation created with Sync, using the same arguments.

IOException

If an I/O error has occurred.

Protected / Constructors

Operation


protected constructor Operation → (1)

runWrap opt : IBeginEnd = null

Optional IBeginEnd object to use for wrapping the call to DoRun.

Creates a new instance of Operation.

Protected / Methods

Do​Run


[ThrowAny]
protected abstract method DoRun → (1)

progress in : IProgressMonitor

The progress monitor object to use (never null).

Performs the actual work of this operation.

Configuration

Config


public static attribute Config → (get)

value : IConfigurator<IOperation>

[not-null]
The configurator object.

The configurator object for this type.