Path.Of 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| Of(URI) |
已淘汰.
透過轉換 URI 回傳 a |
| Of(String, String[]) |
已淘汰.
|
Of(URI)
警告
Use 'Java.Nio.FileNio.IPath.Of'. This class will be removed in a future release.
透過轉換 URI 回傳 a Path 。
[Android.Runtime.Register("of", "(Ljava/net/URI;)Ljava/nio/file/Path;", "", ApiSince=34)]
[System.Obsolete("Use 'Java.Nio.FileNio.IPath.Of'. This class will be removed in a future release.")]
public static Java.Nio.FileNio.IPath? Of(Java.Net.URI? uri);
[<Android.Runtime.Register("of", "(Ljava/net/URI;)Ljava/nio/file/Path;", "", ApiSince=34)>]
[<System.Obsolete("Use 'Java.Nio.FileNio.IPath.Of'. This class will be removed in a future release.")>]
static member Of : Java.Net.URI -> Java.Nio.FileNio.IPath
參數
- uri
- URI
URI 要轉換
傳回
結果 Path
- 屬性
備註
透過轉換 URI 回傳 a Path 。
此方法會遍歷提供者 FileSystemProvider#installedProviders() installed ,以找出由該 URI URI#getScheme scheme 所識別的提供者。 URI 計畫的比較不以個案為依據。 若找到提供者,則會呼叫其 FileSystemProvider#getPath getPath 方法來轉換 URI。
以預設提供者為例,由 URI 方案「檔案」識別,該 URI 包含非空路徑元件,以及未定義的查詢與片段元件。 權威元件是否存在則視平台而異。 返回 Path 的檔案會與 FileSystems#getDefault default 檔案系統相關聯。
預設供應商也會提供類似 <的 em>往返</em> 保證給該 java.io.File 類別。 對於給定Path的 p,只要Path原始、、與URI新 Path 都在同一台 Java 虛擬機器中(可能是不同的調用)所建立,則 blockquotePath.of(>p.Path#toUri() toUri.()).equals(Path#toAbsolutePath() toAbsolutePath())<p/blockquote> 是有保證<的。 其他醫療提供者是否提供任何保證,視提供者而定,因此未明確說明。
新增11。
Java 文件 java.nio.file.Path.of(java.net.URI)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
Of(String, String[])
警告
Use 'Java.Nio.FileNio.IPath.Of'. This class will be removed in a future release.
[Android.Runtime.Register("of", "(Ljava/lang/String;[Ljava/lang/String;)Ljava/nio/file/Path;", "", ApiSince=34)]
[System.Obsolete("Use 'Java.Nio.FileNio.IPath.Of'. This class will be removed in a future release.")]
public static Java.Nio.FileNio.IPath? Of(string? first, params string[]? more);
[<Android.Runtime.Register("of", "(Ljava/lang/String;[Ljava/lang/String;)Ljava/nio/file/Path;", "", ApiSince=34)>]
[<System.Obsolete("Use 'Java.Nio.FileNio.IPath.Of'. This class will be removed in a future release.")>]
static member Of : string * string[] -> Java.Nio.FileNio.IPath
參數
- first
- String
- more
- String[]
傳回
- 屬性