File Exists
Summary
- Internal name:
FileExists - Category: File System
- Purpose: Check whether a file or a directory exists at the given path. Branches the workflow:
trueif it exists,falseotherwise. - Task type: Condition
Compatibility
-
Minimum AndroMate version:
1.1.0 -
Maximum AndroMate version:
1.1.0 -
Minimum Android:
Android 13 (API 33) -
Maximum Android tested:
Android 16 (API 36) -
Required permissions:
MANAGE_EXTERNAL_STORAGE
Detailed description
The File Exists task checks the presence of a path on the device file system using File.exists(). It acts as a condition node: the workflow branches to the true path if the file or directory exists, and to the false path otherwise.
The check returns true for both files and directories — it only tells you whether the path is present, not its type.
Input parameters
| Parameter | Type | Required | Possible values / Rules | Android Compatibility | AndroMate Compatibility | Default |
|---|---|---|---|---|---|---|
file_path |
String | Yes | Path to a file or directory (supports interpolation) | Android 13 (API 33) → Android 16 (API 36) | 1.1.0 → 1.1.0 | "" |
Output parameters
This is a Condition task — it does not store a value. Instead, it directs workflow execution:
| Condition | Next step |
|---|---|
| The path exists (file or directory) | true branch |
| The path does not exist | false branch |
Exceptions
This task does not throw exceptions. A missing path routes to the false branch.
Execution flowchart
flowchart TD
Start([▶ FileExists]) --> Resolve[🔧 Resolve file_path]
Resolve --> Check[📁 File.exists]
Check --> Exists{Exists ?}
Exists -->|Yes| TrueBranch([✅ true branch])
Exists -->|No| FalseBranch([❌ false branch])
style Start fill:#e3f2fd
style TrueBranch fill:#c8e6c9
style FalseBranch fill:#ffcdd2
style Check fill:#fff9c4
How it works:
- Resolve: the
file_pathis resolved against the AndroMate context - Check:
File.exists()is evaluated - Branch: exists →
truebranch; otherwise →falsebranch
Code examples
Example 1 — Branch on a config file presence
{
"FileExists": [
{
"id": "1",
"title": "Config exists ?",
"file_path": "/sdcard/AndromateFileTask/config.json"
}
]
}
Input parameter details
file_path — Path to check
Absolute path to a file or directory. Supports $variable and ${SPECIAL_VAR} interpolation. The check succeeds for both files and directories.
Output parameter details
This is a Condition task — it stores no output variable. The result drives the workflow branching (true / false).