インタフェース
java.nio.file.Pathの使用
| パッケージ | 説明 |
|---|---|
| java.io |
このパッケージは、データ・ストリーム、直列化、ファイル・システムによるシステム入出力用に提供されています。
|
| java.lang.module |
モジュール記述子をサポートし、解決とサービス・バインディングによってモジュールの構成を作成するクラス。
|
| java.net.http |
HTTPクライアントおよびWebSocket API
|
| java.nio.channels |
入出力操作を実行できるエンティティ(ファイル、ソケットなど)への接続を表すチャネルや、多重化された非ブロック入出力操作用のセレクタを定義します。
|
| java.nio.file |
ファイル、ファイル属性、およびファイル・システムにアクセスするためのJava仮想マシン用のインタフェースとクラスを定義します。
|
| java.nio.file.spi |
java.nio.fileパッケージのサービス・プロバイダ・クラス。 |
| java.util |
コレクション・フレームワーク、国際化サポート・クラス、サービス・ローダー、プロパティ、乱数生成、文字列解析とスキャン・クラス、Base64エンコーディングとデコード、ビット配列、およびその他のユーティリティ・クラスが含まれています。
|
| javax.tools |
コンパイラなどのプログラムから呼び出せるツールのインタフェースを提供します。
|
| jdk.jfr |
このパッケージは、イベントを作成してFlight Recorderを制御するクラスを提供します。
|
| jdk.jfr.consumer |
このパッケージには、Flight Recorderデータを使用するためのクラスが含まれています。
|
| jdk.nashorn.api.tree |
NashornパーサーAPIは、ECMAScriptソース・コードを抽象構文ツリー(AST)およびParserとして表現するためのインタフェースを提供し、ECMAScriptソース・スクリプトを解析します。
|
-
java.ioでのPathの使用
Pathを返すjava.ioのメソッド 修飾子と型 メソッド 説明 PathFile. toPath()この抽象パスから構築されたjava.nio.file.Pathオブジェクトを返します。 -
java.lang.moduleでのPathの使用
型Pathのパラメータを持つjava.lang.moduleのメソッド 修飾子と型 メソッド 説明 static ModuleFinderModuleFinder. of(Path... entries)一連のディレクトリおよび/またはパッケージ化されたモジュールを検索して、ファイル・システム上のモジュールを見つけるモジュール・ファインダを返します。 -
java.net.httpでのPathの使用
型Pathの引数を持つ型を返すjava.net.httpのメソッド 修飾子と型 メソッド 説明 static HttpResponse.BodyHandler<Path>HttpResponse.BodyHandlers. ofFile(Path file)BodySubscriber<Path>を返すBodyHandler<Path>を返します。static HttpResponse.BodyHandler<Path>HttpResponse.BodyHandlers. ofFile(Path file, OpenOption... openOptions)BodySubscribers.ofFile(Path,OpenOption...)から取得されたBodySubscriber<Path>を返すBodyHandler<Path>を返します。static HttpResponse.BodySubscriber<Path>HttpResponse.BodySubscribers. ofFile(Path file)指定された名前でオープンされたファイルにレスポンス本文を格納するBodySubscriberを返します。static HttpResponse.BodySubscriber<Path>HttpResponse.BodySubscribers. ofFile(Path file, OpenOption... openOptions)与えられたオプションと名前でオープンされたファイルにレスポンス本文を格納するBodySubscriberを返します。static HttpResponse.BodyHandler<Path>HttpResponse.BodyHandlers. ofFileDownload(Path directory, OpenOption... openOptions)ダウンロード・ディレクトリが指定されているBodySubscriber<Path>を返すBodyHandler<Path>を返しますが、ファイル名はContent-Dispositionレスポンス・ヘッダーから取得されます。型Pathのパラメータを持つjava.net.httpのメソッド 修飾子と型 メソッド 説明 static HttpRequest.BodyPublisherHttpRequest.BodyPublishers. ofFile(Path path)ファイルの内容からデータを取得するリクエスト・ボディ・パブリッシャ。static HttpResponse.BodyHandler<Path>HttpResponse.BodyHandlers. ofFile(Path file)BodySubscriber<Path>を返すBodyHandler<Path>を返します。static HttpResponse.BodyHandler<Path>HttpResponse.BodyHandlers. ofFile(Path file, OpenOption... openOptions)BodySubscribers.ofFile(Path,OpenOption...)から取得されたBodySubscriber<Path>を返すBodyHandler<Path>を返します。static HttpResponse.BodySubscriber<Path>HttpResponse.BodySubscribers. ofFile(Path file)指定された名前でオープンされたファイルにレスポンス本文を格納するBodySubscriberを返します。static HttpResponse.BodySubscriber<Path>HttpResponse.BodySubscribers. ofFile(Path file, OpenOption... openOptions)与えられたオプションと名前でオープンされたファイルにレスポンス本文を格納するBodySubscriberを返します。static HttpResponse.BodyHandler<Path>HttpResponse.BodyHandlers. ofFileDownload(Path directory, OpenOption... openOptions)ダウンロード・ディレクトリが指定されているBodySubscriber<Path>を返すBodyHandler<Path>を返しますが、ファイル名はContent-Dispositionレスポンス・ヘッダーから取得されます。 -
java.nio.channelsでのPathの使用
Path型のパラメータを持つjava.nio.channelsのメソッド 修飾子と型 メソッド 説明 static AsynchronousFileChannelAsynchronousFileChannel. open(Path file, OpenOption... options)読み込みまたは書き込み(あるいはその両方)用のファイルを開くか作成し、そのファイルにアクセスするための非同期のファイル・チャネルを返します。static AsynchronousFileChannelAsynchronousFileChannel. open(Path file, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs)読み込みまたは書き込み(あるいはその両方)用のファイルを開くか作成し、そのファイルにアクセスするための非同期のファイル・チャネルを返します。static FileChannelFileChannel. open(Path path, OpenOption... options)ファイルを開くか作成し、そのファイルにアクセスするためのファイル・チャネルを返します。static FileChannelFileChannel. open(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs)ファイルを開くか作成し、そのファイルにアクセスするためのファイル・チャネルを返します。 -
java.nio.fileでのPathの使用
Path型の型パラメータを持つjava.nio.fileのフィールド 修飾子と型 フィールド 説明 static WatchEvent.Kind<Path>StandardWatchEventKinds. ENTRY_CREATEディレクトリ・エントリが作成されました。static WatchEvent.Kind<Path>StandardWatchEventKinds. ENTRY_DELETEディレクトリ・エントリが削除されました。static WatchEvent.Kind<Path>StandardWatchEventKinds. ENTRY_MODIFYディレクトリ・エントリが変更されました。Pathを返すjava.nio.fileのメソッド 修飾子と型 メソッド 説明 static PathFiles. copy(Path source, Path target, CopyOption... options)ファイルをターゲット・ファイルにコピーします。static PathFiles. createDirectories(Path dir, FileAttribute<?>... attrs)存在しないすべての親ディレクトリをまず作成することで、ディレクトリを作成します。static PathFiles. createDirectory(Path dir, FileAttribute<?>... attrs)新しいディレクトリを作成します。static PathFiles. createFile(Path path, FileAttribute<?>... attrs)新しい空のファイルを作成し、ファイルがすでに存在する場合は失敗します。static PathFiles. createLink(Path link, Path existing)既存のファイルに対して新しいリンク(ディレクトリ・エントリ)を作成します(オプションの操作)。static PathFiles. createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs)ターゲットへのシンボリック・リンクを作成します(オプションの操作)。static PathFiles. createTempDirectory(String prefix, FileAttribute<?>... attrs)デフォルトの一時ファイル・ディレクトリで新しいディレクトリを生成し、その名前には、指定された接頭辞が使用されます。static PathFiles. createTempDirectory(Path dir, String prefix, FileAttribute<?>... attrs)指定されたディレクトリで新しいディレクトリを生成し、その名前には、指定された接頭辞が使用されます。static PathFiles. createTempFile(String prefix, String suffix, FileAttribute<?>... attrs)指定された接頭辞と接尾辞をファイル名の生成に使用して、デフォルトの一時ファイル・ディレクトリに空のファイルを生成します。static PathFiles. createTempFile(Path dir, String prefix, String suffix, FileAttribute<?>... attrs)指定されたディレクトリで新しい空のファイルを生成し、その名前には、指定された接頭辞および接尾辞の文字列が使用されます。static PathPaths. get(String first, String... more)1つのパス文字列または、連結すると1つのパス文字列を形成する文字列のシーケンスを、Pathに変換します。static PathPaths. get(URI uri)指定されたURIをPathオブジェクトに変換します。PathPath. getFileName()このパスが示すファイルまたはディレクトリの名前をPathオブジェクトとして返します。PathPath. getName(int index)このパスの名前要素をPathオブジェクトとして返します。PathPath. getParent()親のパスを返します。このパスが親を持たない場合はnullを返します。abstract PathFileSystem. getPath(String first, String... more)1つのパス文字列または、連結すると1つのパス文字列を形成する文字列のシーケンスを、Pathに変換します。PathPath. getRoot()このパスのルート・コンポーネントをPathオブジェクトとして返します。このパスがルート・コンポーネントを持たない場合はnullを返します。static PathFiles. move(Path source, Path target, CopyOption... options)ファイルをターゲット・ファイルに移動するか、そのファイル名を変更します。PathPath. normalize()このパスから冗長な名前要素を削除したパスを返します。static PathPath. of(String first, String... more)パス文字列、または結合時にパス文字列を形成する文字列のシーケンスを変換することにより、Pathを返します。static PathPath. of(URI uri)URIを変換することによってPathを返します。static PathFiles. readSymbolicLink(Path link)シンボリック・リンクのターゲットを読み取ります(オプションの操作)。PathPath. relativize(Path other)このパスと指定されたパスとの間の相対パスを構築します。default PathPath. resolve(String other)指定されたパス文字列をPathに変換してから、resolveメソッドで指定されたとおりの方法で、このPathに対して解決します。PathPath. resolve(Path other)指定されたパスをこのパスに対して解決します。default PathPath. resolveSibling(String other)指定されたパス文字列をPathに変換してから、resolveSiblingメソッドで指定されたとおりの方法で、このパスの親パスに対して解決します。default PathPath. resolveSibling(Path other)指定されたパスをこのパスの親パスに対して解決します。static PathFiles. setAttribute(Path path, String attribute, Object value, LinkOption... options)ファイル属性の値を設定します。static PathFiles. setLastModifiedTime(Path path, FileTime time)ファイルの最終変更時間属性を更新します。static PathFiles. setOwner(Path path, UserPrincipal owner)ファイル所有者を更新します。static PathFiles. setPosixFilePermissions(Path path, Set<PosixFilePermission> perms)ファイルのPOSIXファイル・アクセス権を設定します。PathPath. subpath(int beginIndex, int endIndex)このパスの名前要素のサブシーケンスである相対Pathを返します。PathPath. toAbsolutePath()このパスの絶対パスを表すPathオブジェクトを返します。PathPath. toRealPath(LinkOption... options)既存のファイルの実際のパスを返します。static PathFiles. walkFileTree(Path start, FileVisitor<? super Path> visitor)ファイル・ツリーを参照します。static PathFiles. walkFileTree(Path start, Set<FileVisitOption> options, int maxDepth, FileVisitor<? super Path> visitor)ファイル・ツリーを参照します。static PathFiles. write(Path path, byte[] bytes, OpenOption... options)バイトをファイルに書き込みます。static PathFiles. write(Path path, Iterable<? extends CharSequence> lines, Charset cs, OpenOption... options)テキスト行をファイルに書き込みます。static PathFiles. write(Path path, Iterable<? extends CharSequence> lines, OpenOption... options)テキスト行をファイルに書き込みます。static PathFiles. writeString(Path path, CharSequence csq, Charset cs, OpenOption... options)CharSequenceをファイルに書き込みます。static PathFiles. writeString(Path path, CharSequence csq, OpenOption... options)CharSequenceをファイルに書き込みます。Path型の引数を持つ型を返すjava.nio.fileのメソッド 修飾子と型 メソッド 説明 static Stream<Path>Files. find(Path start, int maxDepth, BiPredicate<Path,BasicFileAttributes> matcher, FileVisitOption... options)指定された開始ファイルをルートとするファイル・ツリー内でファイルを検索することでPathが遅延設定されるStreamを返します。abstract Iterable<Path>FileSystem. getRootDirectories()ルート・ディレクトリのパスを反復するためのオブジェクトを返します。default Iterator<Path>Path. iterator()このパスの名前要素を処理するイテレータを返します。static Stream<Path>Files. list(Path dir)ディレクトリ内のエントリを要素に持つ遅延設定Streamを返します。static DirectoryStream<Path>Files. newDirectoryStream(Path dir)ディレクトリを開き、ディレクトリ内のすべてのエントリを反復するためのDirectoryStreamを返します。static DirectoryStream<Path>Files. newDirectoryStream(Path dir, String glob)ディレクトリを開き、そのディレクトリ内のエントリに対して反復処理を行うDirectoryStreamを返します。static DirectoryStream<Path>Files. newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter)ディレクトリを開き、そのディレクトリ内のエントリに対して反復処理を行うDirectoryStreamを返します。static Stream<Path>Files. walk(Path start, int maxDepth, FileVisitOption... options)指定された開始ファイルをルートとするファイル・ツリーを参照することでPathが遅延移入されるStreamを返します。static Stream<Path>Files. walk(Path start, FileVisitOption... options)指定された開始ファイルをルートとするファイル・ツリーを参照することでPathが遅延移入されるStreamを返します。Path型のパラメータを持つjava.nio.fileのメソッド 修飾子と型 メソッド 説明 intPath. compareTo(Path other)2つの抽象パスを語彙的に比較します。static longFiles. copy(InputStream in, Path target, CopyOption... options)すべてのバイトを入力ストリームからファイルにコピーします。static longFiles. copy(Path source, OutputStream out)すべてのバイトをファイルから出力ストリームにコピーします。static PathFiles. copy(Path source, Path target, CopyOption... options)ファイルをターゲット・ファイルにコピーします。static PathFiles. createDirectories(Path dir, FileAttribute<?>... attrs)存在しないすべての親ディレクトリをまず作成することで、ディレクトリを作成します。static PathFiles. createDirectory(Path dir, FileAttribute<?>... attrs)新しいディレクトリを作成します。static PathFiles. createFile(Path path, FileAttribute<?>... attrs)新しい空のファイルを作成し、ファイルがすでに存在する場合は失敗します。static PathFiles. createLink(Path link, Path existing)既存のファイルに対して新しいリンク(ディレクトリ・エントリ)を作成します(オプションの操作)。static PathFiles. createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs)ターゲットへのシンボリック・リンクを作成します(オプションの操作)。static PathFiles. createTempDirectory(Path dir, String prefix, FileAttribute<?>... attrs)指定されたディレクトリで新しいディレクトリを生成し、その名前には、指定された接頭辞が使用されます。static PathFiles. createTempFile(Path dir, String prefix, String suffix, FileAttribute<?>... attrs)指定されたディレクトリで新しい空のファイルを生成し、その名前には、指定された接頭辞および接尾辞の文字列が使用されます。static voidFiles. delete(Path path)ファイルを削除します。static booleanFiles. deleteIfExists(Path path)ファイルが存在する場合は削除します。booleanPath. endsWith(Path other)このパスが、指定されたパスで終わるかどうかをテストします。static booleanFiles. exists(Path path, LinkOption... options)ファイルが存在するかどうかをテストします。static Stream<Path>Files. find(Path start, int maxDepth, BiPredicate<Path,BasicFileAttributes> matcher, FileVisitOption... options)指定された開始ファイルをルートとするファイル・ツリー内でファイルを検索することでPathが遅延設定されるStreamを返します。static ObjectFiles. getAttribute(Path path, String attribute, LinkOption... options)ファイル属性の値を読み取ります。static <V extends FileAttributeView>
VFiles. getFileAttributeView(Path path, Class<V> type, LinkOption... options)指定されたタイプのファイル属性ビューを返します。static FileStoreFiles. getFileStore(Path path)ファイルが置かれているファイル・ストアを表すFileStoreを返します。static FileTimeFiles. getLastModifiedTime(Path path, LinkOption... options)ファイルの最終変更時間を返します。static UserPrincipalFiles. getOwner(Path path, LinkOption... options)ファイルの所有者を返します。static Set<PosixFilePermission>Files. getPosixFilePermissions(Path path, LinkOption... options)ファイルのPOSIXファイル・アクセス権を返します。static booleanFiles. isDirectory(Path path, LinkOption... options)ファイルがディレクトリかどうかをテストします。static booleanFiles. isExecutable(Path path)ファイルが実行可能かどうかをテストします。static booleanFiles. isHidden(Path path)ファイルが隠しファイルとみなされるかどうかを判断します。static booleanFiles. isReadable(Path path)ファイルが読取り可能かどうかをテストします。static booleanFiles. isRegularFile(Path path, LinkOption... options)ファイルが不透明な内容の通常ファイルかどうかをテストします。static booleanFiles. isSameFile(Path path, Path path2)2つのパスが同じファイルを検出するかどうかを判断します。static booleanFiles. isSymbolicLink(Path path)ファイルがシンボリック・リンクかどうかをテストします。static booleanFiles. isWritable(Path path)ファイルが書込み可能かどうかをテストします。static Stream<String>Files. lines(Path path)ファイル内のすべての行をStreamとして読み取ります。static Stream<String>Files. lines(Path path, Charset cs)ファイル内のすべての行をStreamとして読み取ります。static Stream<Path>Files. list(Path dir)ディレクトリ内のエントリを要素に持つ遅延設定Streamを返します。booleanPathMatcher. matches(Path path)指定されたパスがこのマッチャのパターンに一致するかどうかを示します。static longFiles. mismatch(Path path, Path path2)2つのファイルのコンテンツ内で、最初の不一致バイトの位置を検索して返します。不一致がない場合は、-1L。static PathFiles. move(Path source, Path target, CopyOption... options)ファイルをターゲット・ファイルに移動するか、そのファイル名を変更します。static BufferedReaderFiles. newBufferedReader(Path path)ファイルを読込み用に開き、効率的な方法でファイルからテキストを読み込むBufferedReaderを返します。static BufferedReaderFiles. newBufferedReader(Path path, Charset cs)ファイルを読取り用に開き、そのファイルから効果的な方法でテキストを読み取るために使用できるBufferedReaderを返します。static BufferedWriterFiles. newBufferedWriter(Path path, Charset cs, OpenOption... options)ファイルを書込み用に開くか作成して、そのファイルに効果的な方法でテキストを書き込むために使用できるBufferedWriterを返します。static BufferedWriterFiles. newBufferedWriter(Path path, OpenOption... options)ファイルを書込み用に開くか作成し、効率的な方法でファイルにテキストを書き込むBufferedWriterを返します。static SeekableByteChannelFiles. newByteChannel(Path path, OpenOption... options)ファイルを開くか作成し、そのファイルにアクセスするためのシーク可能なバイト・チャネルを返します。static SeekableByteChannelFiles. newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs)ファイルを開くか作成し、そのファイルにアクセスするためのシーク可能なバイト・チャネルを返します。static DirectoryStream<Path>Files. newDirectoryStream(Path dir)ディレクトリを開き、ディレクトリ内のすべてのエントリを反復するためのDirectoryStreamを返します。static DirectoryStream<Path>Files. newDirectoryStream(Path dir, String glob)ディレクトリを開き、そのディレクトリ内のエントリに対して反復処理を行うDirectoryStreamを返します。static DirectoryStream<Path>Files. newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter)ディレクトリを開き、そのディレクトリ内のエントリに対して反復処理を行うDirectoryStreamを返します。static FileSystemFileSystems. newFileSystem(Path path)ファイルの内容にファイル・システムとしてアクセスする新しいFileSystemを構築します。static FileSystemFileSystems. newFileSystem(Path path, ClassLoader loader)ファイルの内容にファイル・システムとしてアクセスする新しいFileSystemを構築します。static FileSystemFileSystems. newFileSystem(Path path, Map<String,?> env)ファイルの内容にファイル・システムとしてアクセスする新しいFileSystemを構築します。static FileSystemFileSystems. newFileSystem(Path path, Map<String,?> env, ClassLoader loader)ファイルの内容にファイル・システムとしてアクセスする新しいFileSystemを構築します。static InputStreamFiles. newInputStream(Path path, OpenOption... options)ファイルを開き、そのファイルから読み取る入力ストリームを返します。static OutputStreamFiles. newOutputStream(Path path, OpenOption... options)ファイルを開くか作成して、そのファイルにバイトを書き込むために使用できる出力ストリームを返します。static booleanFiles. notExists(Path path, LinkOption... options)このパスが示すファイルが存在しないかどうかをテストします。static StringFiles. probeContentType(Path path)ファイルのコンテンツ・タイプを調べます。static byte[]Files. readAllBytes(Path path)ファイルからすべてのバイトを読み取ります。static List<String>Files. readAllLines(Path path)ファイルからすべての行を読み取ります。static List<String>Files. readAllLines(Path path, Charset cs)ファイルからすべての行を読み取ります。static <A extends BasicFileAttributes>
AFiles. readAttributes(Path path, Class<A> type, LinkOption... options)一括操作としてファイル属性を読み取ります。static Map<String,Object>Files. readAttributes(Path path, String attributes, LinkOption... options)一括操作として一連のファイル属性を読み取ります。static StringFiles. readString(Path path)static StringFiles. readString(Path path, Charset cs)ファイルのすべての文字を文字列に読み込み、指定されたcharsetを使用してバイトから文字にデコードします。static PathFiles. readSymbolicLink(Path link)シンボリック・リンクのターゲットを読み取ります(オプションの操作)。PathPath. relativize(Path other)このパスと指定されたパスとの間の相対パスを構築します。PathPath. resolve(Path other)指定されたパスをこのパスに対して解決します。default PathPath. resolveSibling(Path other)指定されたパスをこのパスの親パスに対して解決します。static PathFiles. setAttribute(Path path, String attribute, Object value, LinkOption... options)ファイル属性の値を設定します。static PathFiles. setLastModifiedTime(Path path, FileTime time)ファイルの最終変更時間属性を更新します。static PathFiles. setOwner(Path path, UserPrincipal owner)ファイル所有者を更新します。static PathFiles. setPosixFilePermissions(Path path, Set<PosixFilePermission> perms)ファイルのPOSIXファイル・アクセス権を設定します。static longFiles. size(Path path)ファイルのサイズをバイトで返します。booleanPath. startsWith(Path other)このパスが、指定されたパスで始まるかどうかをテストします。static Stream<Path>Files. walk(Path start, int maxDepth, FileVisitOption... options)指定された開始ファイルをルートとするファイル・ツリーを参照することでPathが遅延移入されるStreamを返します。static Stream<Path>Files. walk(Path start, FileVisitOption... options)指定された開始ファイルをルートとするファイル・ツリーを参照することでPathが遅延移入されるStreamを返します。static PathFiles. walkFileTree(Path start, FileVisitor<? super Path> visitor)ファイル・ツリーを参照します。static PathFiles. walkFileTree(Path start, Set<FileVisitOption> options, int maxDepth, FileVisitor<? super Path> visitor)ファイル・ツリーを参照します。static PathFiles. write(Path path, byte[] bytes, OpenOption... options)バイトをファイルに書き込みます。static PathFiles. write(Path path, Iterable<? extends CharSequence> lines, Charset cs, OpenOption... options)テキスト行をファイルに書き込みます。static PathFiles. write(Path path, Iterable<? extends CharSequence> lines, OpenOption... options)テキスト行をファイルに書き込みます。static PathFiles. writeString(Path path, CharSequence csq, Charset cs, OpenOption... options)CharSequenceをファイルに書き込みます。static PathFiles. writeString(Path path, CharSequence csq, OpenOption... options)CharSequenceをファイルに書き込みます。Path型の型引数を持つjava.nio.fileのメソッド・パラメータ 修飾子と型 メソッド 説明 static Stream<Path>Files. find(Path start, int maxDepth, BiPredicate<Path,BasicFileAttributes> matcher, FileVisitOption... options)指定された開始ファイルをルートとするファイル・ツリー内でファイルを検索することでPathが遅延設定されるStreamを返します。static DirectoryStream<Path>Files. newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter)ディレクトリを開き、そのディレクトリ内のエントリに対して反復処理を行うDirectoryStreamを返します。static PathFiles. walkFileTree(Path start, FileVisitor<? super Path> visitor)ファイル・ツリーを参照します。static PathFiles. walkFileTree(Path start, Set<FileVisitOption> options, int maxDepth, FileVisitor<? super Path> visitor)ファイル・ツリーを参照します。 -
java.nio.file.spiでのPathの使用
Pathを返すjava.nio.file.spiのメソッド 修飾子と型 メソッド 説明 abstract PathFileSystemProvider. getPath(URI uri)指定されたURIを変換することによって、Pathオブジェクトを返します。PathFileSystemProvider. readSymbolicLink(Path link)シンボリック・リンクのターゲットを読み取ります。Path型の引数を持つ型を返すjava.nio.file.spiのメソッド 修飾子と型 メソッド 説明 abstract DirectoryStream<Path>FileSystemProvider. newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter)ディレクトリを開き、そのディレクトリ内のエントリに対して反復処理を行うDirectoryStreamを返します。Path型のパラメータを持つjava.nio.file.spiのメソッド 修飾子と型 メソッド 説明 abstract voidFileSystemProvider. checkAccess(Path path, AccessMode... modes)ファイルの存在および、オプションでアクセシビリティをチェックします。abstract voidFileSystemProvider. copy(Path source, Path target, CopyOption... options)ファイルをターゲット・ファイルにコピーします。abstract voidFileSystemProvider. createDirectory(Path dir, FileAttribute<?>... attrs)新しいディレクトリを作成します。voidFileSystemProvider. createLink(Path link, Path existing)既存のファイルに対して新しいリンク(ディレクトリ・エントリ)を作成します。voidFileSystemProvider. createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs)ターゲットへのシンボリック・リンクを作成します。abstract voidFileSystemProvider. delete(Path path)ファイルを削除します。booleanFileSystemProvider. deleteIfExists(Path path)ファイルが存在する場合は削除します。abstract <V extends FileAttributeView>
VFileSystemProvider. getFileAttributeView(Path path, Class<V> type, LinkOption... options)指定されたタイプのファイル属性ビューを返します。abstract FileStoreFileSystemProvider. getFileStore(Path path)ファイルが置かれているファイル・ストアを表すFileStoreを返します。abstract booleanFileSystemProvider. isHidden(Path path)ファイルが隠しファイルとみなされるかどうかを判断します。abstract booleanFileSystemProvider. isSameFile(Path path, Path path2)2つのパスが同じファイルを検出するかどうかを判断します。abstract voidFileSystemProvider. move(Path source, Path target, CopyOption... options)ファイルをターゲット・ファイルに移動するか、そのファイル名を変更します。AsynchronousFileChannelFileSystemProvider. newAsynchronousFileChannel(Path path, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs)読み込みまたは書き込み(あるいはその両方)用のファイルを開くか作成し、そのファイルにアクセスするための非同期のファイル・チャネルを返します。abstract SeekableByteChannelFileSystemProvider. newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs)ファイルを開くか作成し、そのファイルにアクセスするためのシーク可能なバイト・チャネルを返します。abstract DirectoryStream<Path>FileSystemProvider. newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter)ディレクトリを開き、そのディレクトリ内のエントリに対して反復処理を行うDirectoryStreamを返します。FileChannelFileSystemProvider. newFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs)読み取りまたは書き込み(あるいはその両方)用のファイルを開くか作成し、そのファイルにアクセスするためのファイル・チャネルを返します。FileSystemFileSystemProvider. newFileSystem(Path path, Map<String,?> env)ファイルの内容にファイル・システムとしてアクセスする新しいFileSystemを構築します。InputStreamFileSystemProvider. newInputStream(Path path, OpenOption... options)ファイルを開き、そのファイルから読み取る入力ストリームを返します。OutputStreamFileSystemProvider. newOutputStream(Path path, OpenOption... options)ファイルを開くか作成して、そのファイルにバイトを書き込むために使用できる出力ストリームを返します。abstract StringFileTypeDetector. probeContentType(Path path)指定されたファイルを調べてコンテンツ・タイプを推察します。abstract <A extends BasicFileAttributes>
AFileSystemProvider. readAttributes(Path path, Class<A> type, LinkOption... options)一括操作としてファイル属性を読み取ります。abstract Map<String,Object>FileSystemProvider. readAttributes(Path path, String attributes, LinkOption... options)一括操作として一連のファイル属性を読み取ります。PathFileSystemProvider. readSymbolicLink(Path link)シンボリック・リンクのターゲットを読み取ります。abstract voidFileSystemProvider. setAttribute(Path path, String attribute, Object value, LinkOption... options)ファイル属性の値を設定します。Path型の型引数を持つjava.nio.file.spiのメソッド・パラメータ 修飾子と型 メソッド 説明 abstract DirectoryStream<Path>FileSystemProvider. newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter)ディレクトリを開き、そのディレクトリ内のエントリに対して反復処理を行うDirectoryStreamを返します。 -
java.utilでのPathの使用
-
javax.toolsでのPathの使用
Pathを戻すjavax.toolsのメソッド 修飾子と型 メソッド 説明 default PathStandardJavaFileManager. asPath(FileObject file)このファイル・オブジェクト(オプションの操作)の基礎をなすパス(存在する場合)を返します。PathStandardJavaFileManager.PathFactory. getPath(String first, String... more)1つのパス文字列または、連結すると1つのパス文字列を形成する文字列のシーケンスを、Pathに変換します。型Pathの引数を持つ型を返すjavax.toolsのメソッド 修飾子と型 メソッド 説明 default Iterable<? extends Path>StandardJavaFileManager. getLocationAsPaths(JavaFileManager.Location location)指定されたロケーションに関連付けられた検索パスを返します。型Pathのパラメータを持つjavax.toolsのメソッド 修飾子と型 メソッド 説明 default Iterable<? extends JavaFileObject>StandardJavaFileManager. getJavaFileObjects(Path... paths)指定されたパスを表すファイル・オブジェクトを返します。型Pathの型引数を持つjavax.toolsのメソッド・パラメータ 修飾子と型 メソッド 説明 default Iterable<? extends JavaFileObject>StandardJavaFileManager. getJavaFileObjectsFromPaths(Iterable<? extends Path> paths)非推奨。そのような引数を1つのPathで誤ってメソッドをコールする可能性をなくすには、StandardJavaFileManager.getJavaFileObjectsFromPaths(Collection)を使用します。default Iterable<? extends JavaFileObject>StandardJavaFileManager. getJavaFileObjectsFromPaths(Collection<? extends Path> paths)指定されたパスを表すファイル・オブジェクトを返します。default voidStandardJavaFileManager. setLocationForModule(JavaFileManager.Location location, String moduleName, Collection<? extends Path> paths)指定された検索パスを、指定されたモジュールとロケーションに関連付けます。これは、モジュール指向または出力ロケーションでなければなりません。default voidStandardJavaFileManager. setLocationFromPaths(JavaFileManager.Location location, Collection<? extends Path> paths)指定された検索パスを指定されたロケーションに関連付けます。 -
jdk.jfrでのPathの使用
Pathを戻すjdk.jfrのメソッド 修飾子と型 メソッド 説明 PathRecording. getDestination()レコーディングが停止したときにレコーディング・データが書き込まれる宛先ファイルを返します。宛先が設定されていない場合はnullを返します。型Pathのパラメータを持つjdk.jfrのメソッド 修飾子と型 メソッド 説明 static ConfigurationConfiguration. create(Path path)ファイルから構成を読み込みます。voidRecording. dump(Path destination)レコーディング・データをファイルに書き込みます。voidRecording. setDestination(Path destination)データがレコーディング停止時に書き込まれるロケーション、またはデータがダンプされない場合はnullを設定します。 -
jdk.jfr.consumerでのPathの使用
型Pathのパラメータを持つjdk.jfr.consumerのメソッド 修飾子と型 メソッド 説明 static List<RecordedEvent>RecordingFile. readAllEvents(Path path)ファイル内のすべてのイベントのリストを返します。型Pathのパラメータを持つjdk.jfr.consumerのコンストラクタ コンストラクタ 説明 RecordingFile(Path file)レコーディング・ファイルを作成します。 -
jdk.nashorn.api.treeでのPathの使用
型Pathのパラメータを持つjdk.nashorn.api.treeのメソッド 修飾子と型 メソッド 説明 CompilationUnitTreeParser. parse(Path path, DiagnosticListener listener)削除予定のため非推奨: このAPI要素は、将来のバージョンで削除される可能性があります。ソース・パスを解析し、コンパイル単位ツリーを返します。