@InputRequirement(value=INPUT_REQUIRED) @Tags(value={"local","files","filesystem","ingest","ingress","get","source","input","fetch"}) @CapabilityDescription(value="Reads the contents of a file from disk and streams it into the contents of an incoming FlowFile. Once this is done, the file is optionally moved elsewhere or deleted to help keep the file system organized.") @SeeAlso(value={GetFile.class,PutFile.class,ListFile.class}) @Restriction(requiredPermission=READ_FILESYSTEM,explanation="Provides operator the ability to read from any file that NiFi has access to.") @Restriction(requiredPermission=WRITE_FILESYSTEM,explanation="Provides operator the ability to delete any file that NiFi has access to.") public class FetchFile extends AbstractProcessor
| Constructor and Description |
|---|
FetchFile() |
| Modifier and Type | Method and Description |
|---|---|
protected Collection<ValidationResult> |
customValidate(ValidationContext validationContext) |
protected void |
delete(File file) |
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
protected boolean |
isDirectory(File file) |
protected boolean |
isReadable(File file) |
protected boolean |
isWritable(File file) |
protected void |
move(File source,
File target,
boolean overwrite) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
private void |
performCompletionAction(String completionStrategy,
File file,
String targetDirectoryName,
FlowFile flowFile,
ProcessContext context) |
onTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueequals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStatefulgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatestatic final AllowableValue COMPLETION_NONE
static final AllowableValue COMPLETION_MOVE
static final AllowableValue COMPLETION_DELETE
static final AllowableValue CONFLICT_REPLACE
static final AllowableValue CONFLICT_KEEP_INTACT
static final AllowableValue CONFLICT_FAIL
static final AllowableValue CONFLICT_RENAME
static final PropertyDescriptor FILENAME
static final PropertyDescriptor COMPLETION_STRATEGY
static final PropertyDescriptor MOVE_DESTINATION_DIR
static final PropertyDescriptor CONFLICT_STRATEGY
static final PropertyDescriptor FILE_NOT_FOUND_LOG_LEVEL
static final PropertyDescriptor PERM_DENIED_LOG_LEVEL
static final Relationship REL_SUCCESS
static final Relationship REL_NOT_FOUND
static final Relationship REL_PERMISSION_DENIED
static final Relationship REL_FAILURE
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponentpublic Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorprotected Collection<ValidationResult> customValidate(ValidationContext validationContext)
customValidate in class AbstractConfigurableComponentpublic void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger in class AbstractProcessorProcessExceptionprivate void performCompletionAction(String completionStrategy, File file, String targetDirectoryName, FlowFile flowFile, ProcessContext context)
protected void move(File source, File target, boolean overwrite) throws IOException
IOExceptionprotected void delete(File file) throws IOException
IOExceptionprotected boolean isReadable(File file)
protected boolean isWritable(File file)
protected boolean isDirectory(File file)
Copyright © 2023 Apache NiFi Project. All rights reserved.