FileUtil extension

File management utilities.

on

Properties

absolutePath String
Return absolute path of current File or Folder as String.
no setter
maybeCreate FileSystemEntity
Check if the Directory exists and if not create it recursively.
no setter
maybeDelete FileSystemEntity
Check if the Directory exists and then delete it.
no setter
normalizeToFile File
Return absolute path of current File or Directory with all forward slashes ('/') replaced for the platform specific separator.
no setter
normalizeToFolder Directory
Return absolute path of current File or Directory with all forward slashes ('/') replaced for the platform specific separator.
no setter
verifyExists File
Create an absolute path to the given file.
no setter

Methods

ifNotExists(void doElse(FileSystemEntity file)) → void
Execute a fallback function if FileSystemEntity does not exist.
orElse(void doElse(FileSystemEntity file)) FileSystemEntity
Return FileSystemEntity or execute a fallback function if it does not exist.
resolveFile(String filename) File
Return a normalized path of this folder to the given filename.
resolveFolder(String folder) Directory
Return a normalized path of this folder to the given filename.