Skip to main content

DeleteFile

Description

Deletes a file from the filesystem.

Tags

delete, file, files, filesystem, local, remove

Properties

In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Directory Path *Directory Path${absolute.path}The path to the directory the file to delete is located in.

Supports Expression Language, using FlowFile attributes and Environment variables.
Filename *Filename${filename}The name of the file to delete.

Supports Expression Language, using FlowFile attributes and Environment variables.

Dynamic Properties

This component does not support dynamic properties.

Relationships

NameDescription
failureAll FlowFiles, for which an existing file could not be deleted, are routed to this relationship
not foundAll FlowFiles, for which the file to delete did not exist, are routed to this relationship
successAll FlowFiles, for which an existing file has been deleted, are routed to this relationship

Reads Attributes

This processor does not read attributes.

Writes Attributes

This processor does not write attributes.

State Management

This component does not store state.

Restricted

Required PermissionExplanation
read filesystemProvides operator the ability to read from any file that NiFi has access to.
write filesystemProvides operator the ability to delete any file that NiFi has access to.

Input Requirement

This component requires an incoming relationship.

Example Use Cases

Use Case 1

Delete source file only after its processing completed

Configuration

Retrieve a file from the filesystem, e.g. using 'ListFile' and 'FetchFile'.
Process the file using any combination of processors.
Store the resulting file to a destination, e.g. using 'PutSFTP'.
Using 'DeleteFile', delete the file from the filesystem only after the result has been stored.

System Resource Considerations

This component does not specify system resource considerations.

See Also