FilePath class
A class to make it easier to manipulate file system entites. Once paths or
entites are converted into Paths, they can be easily copied, deleted,
joined, and their name retrieved.
Constructors
- FilePath(dynamic entityOrString)
-
Create a new FilePath. The
entityOrStringparameter can be aFileSystemEntityor aString. If aString, this method converts the given path from a platform independent one to a platform dependent path. This conversion will work for relative paths but wouldn't make sense to use for absolute ones.
Properties
- asDirectory → Directory
-
Assume the current file system entity is a
Directoryand return it as such. You would call this instead of entity when the file system entity does not yet exist.read-only - asFile → File
-
Assume the current file system entity is a
Fileand return it as such. You would call this instead of entity when the file system entity does not yet exist.read-only - asLink → Link
-
Assume the current file system entity is a
Linkand return it as such. You would call this instead of entity when the file system entity does not yet exist.read-only - entity → FileSystemEntity
-
read-only
- exists → bool
-
Return whether an entity actually exists for this path. The entity could
be a
File,Directory, orLink.read-only - hashCode → int
-
The hash code for this object. [...]
read-only, override
- isDirectory → bool
-
read-only
- isFile → bool
-
read-only
- isLink → bool
-
read-only
- length → int
-
Return the file length; if this FilePath is not a File, return 0.
read-only
- name → String
-
read-only
- parent → FilePath
-
Returns the containing
Path. Returns a non-null value even if this is a root directory. [...]read-only - path → String
-
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
copy(
FilePath destDir) → FilePath - Copy the the entity to the given destination. Return the newly created FilePath.
-
createDirectory(
{bool recursive: false }) → Directory -
Synchronously create the directory. See also
Directory.createSync. [...] -
createFile(
{bool recursive: false }) → File -
Synchronously create the file. See also
File.createSync. [...] -
createLink(
FilePath target, { bool recursive: false }) → Link -
Synchronously create the link. See also
Link.createSync. [...] -
delete(
) → void - Delete the entity at the path.
-
join(
[dynamic arg0, String arg1, String arg2, String arg3, String arg4, String arg5, String arg6, String arg7, String arg8, String arg9 ]) → FilePath - Join the given path elements to this path, and return a new FilePath object.
-
toString(
) → String -
Returns a string representation of this object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
override
Static Properties
Static Methods
-
createSystemTemp(
[String prefix ]) → FilePath -
Creates a temporary directory in the system temp directory. See
Directory.systemTempandDirectory.createTempSync. Ifprefixis missing or null, the empty string is used forprefix.