Compartilhar via


IPath.Normalize Method

Definition

Returns a path that is this path with redundant name elements eliminated.

[Android.Runtime.Register("normalize", "()Ljava/nio/file/Path;", "GetNormalizeHandler:Java.Nio.FileNio.IPathInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public Java.Nio.FileNio.IPath? Normalize ();
[<Android.Runtime.Register("normalize", "()Ljava/nio/file/Path;", "GetNormalizeHandler:Java.Nio.FileNio.IPathInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member Normalize : unit -> Java.Nio.FileNio.IPath

Returns

the resulting path or this path if it does not contain redundant name elements; an empty path is returned if this path does have a root component and all name elements are redundant

Attributes

Remarks

Returns a path that is this path with redundant name elements eliminated.

The precise definition of this method is implementation dependent but in general it derives from this path, a path that does not contain <em>redundant</em> name elements. In many file systems, the "." and ".." are special names used to indicate the current directory and parent directory. In such file systems all occurrences of "." are considered redundant. If a ".." is preceded by a non-".." name then both names are considered redundant (the process to identify such names is repeated until it is no longer applicable).

This method does not access the file system; the path may not locate a file that exists. Eliminating ".." and a preceding name from a path may result in the path that locates a different file than the original path. This can arise when the preceding name is a symbolic link.

Java documentation for java.nio.file.Path.normalize().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to