parent
Returns the path immediately enclosing this path.
This returns null if this has no parent. That includes these paths:
The file system root (
/
)The identity relative path (
.
)A Windows volume root (like
C:\
)A Windows Universal Naming Convention (UNC) root path (
\\server
)A reference to the current working directory on a Windows volume (
C:
).A series of relative paths (like
..
and../..
).