インタフェース
java.nio.file.Pathの使用
Pathを使用しているパッケージ
パッケージ
説明
組込みのHTTPサーバーの構築に使用できる、単純で高度なHTTPサーバーAPIを提供します。
このパッケージは、データ・ストリーム、直列化、ファイル・システムによるシステム入出力用に提供されています。
Javaランタイム外部のメモリーおよびファンクションへの低レベル・アクセスを提供します。
モジュール記述子をサポートし、解決とサービス・バインディングによってモジュールの構成を作成するクラス。
ネットワーク・アプリケーションを実装するためのクラスを提供します。
HTTPクライアントおよびWebSocket API
入出力操作を実行できるエンティティ(ファイル、ソケットなど)への接続を表すチャネルや、多重化された非ブロック入出力操作用のセレクタを定義します。
ファイル、ファイル属性、およびファイル・システムにアクセスするためのJava仮想マシン用のインタフェースとクラスを定義します。
java.nio.fileパッケージのサービス・プロバイダ・クラス。コレクション・フレームワーク、国際化サポート・クラス、サービス・ローダー、プロパティ、乱数生成、文字列解析とスキャニング・クラス、Base64エンコーディングとデコーディング、ビット配列、およびその他のユーティリティ・クラスが含まれています。
コンパイラなどのプログラムから呼び出せるツールのインタフェースを提供します。
このパッケージは、イベントを作成してFlight Recorderを制御するクラスを提供します。
このパッケージには、Flight Recorderデータを使用するためのクラスが含まれています。
このパッケージには、Java Management Extensions (JMX)のFlight Recorderを制御およびモニターするクラスが含まれています。
-
com.sun.net.httpserverでのPathの使用
型Pathのパラメータを持つcom.sun.net.httpserverのメソッド修飾子と型メソッド説明static HttpHandlerSimpleFileServer.createFileHandler(Path rootDirectory) 指定されたディレクトリ・パス(およびそのサブディレクトリ)のファイルを提供する「ファイル・ハンドラ」を作成します。static HttpServerSimpleFileServer.createFileServer(InetSocketAddress addr, Path rootDirectory, SimpleFileServer.OutputLevel outputLevel) 特定のパスからファイルをサービスする「ファイル・サーバー」を作成します。 -
java.ioでのPathの使用
-
java.lang.foreignでのPathの使用
型Pathのパラメータを持つjava.lang.foreignのメソッド修飾子と型メソッド説明static SymbolLookupPREVIEWSymbolLookup.libraryLookup(Path path, SegmentScopePREVIEW scope) 指定されたパス (まだロードされていない場合)からライブラリをロードし、そのライブラリ内のシンボルのシンボル・ルックアップを作成します。 -
java.lang.moduleでのPathの使用
型パスのパラメータを持つjava.lang.moduleのメソッド修飾子と型メソッド説明static ModuleFinder一連のディレクトリおよび/またはパッケージ化されたモジュールを検索して、ファイル・システム上のモジュールを見つけるモジュール・ファインダを返します。 -
java.netでのPathの使用
-
java.net.httpでのPathの使用
型パスの引数を持つ型を返すjava.net.httpのメソッド修飾子と型メソッド説明static HttpResponse.BodyHandler<Path>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>指定された名前でオープンされたファイルにレスポンス本文を格納する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.net.httpのメソッド修飾子と型メソッド説明static HttpRequest.BodyPublisherファイルの内容からデータを取得するリクエスト・ボディ・パブリッシャ。static HttpResponse.BodyHandler<Path>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>指定された名前でオープンされたファイルにレスポンス本文を格納する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 final WatchEvent.Kind<Path>StandardWatchEventKinds.ENTRY_CREATEディレクトリ・エントリが作成されました。static final WatchEvent.Kind<Path>StandardWatchEventKinds.ENTRY_DELETEディレクトリ・エントリが削除されました。static final 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 Path1つのパス文字列または、連結すると1つのパス文字列を形成する文字列のシーケンスを、Pathに変換します。static Path指定されたURIをPathオブジェクトに変換します。Path.getFileName()このパスが示すファイルまたはディレクトリの名前をPathオブジェクトとして返します。Path.getName(int index) このパスの名前要素をPathオブジェクトとして返します。Path.getParent()親のパスを返します。このパスが親を持たない場合はnullを返します。abstract Path1つのパス文字列または、連結すると1つのパス文字列を形成する文字列のシーケンスを、Pathに変換します。Path.getRoot()このパスのルート・コンポーネントをPathオブジェクトとして返します。このパスがルート・コンポーネントを持たない場合はnullを返します。static PathFiles.move(Path source, Path target, CopyOption... options) ファイルをターゲット・ファイルに移動するか、そのファイル名を変更します。Path.normalize()このパスから冗長な名前要素を削除したパスを返します。static Pathパス文字列、または結合時にパス文字列を形成する文字列のシーケンスを変換することにより、Pathを返します。static PathURIを変換することによってPathを返します。static PathFiles.readSymbolicLink(Path link) シンボリック・リンクのターゲットを読み取ります(オプションの操作)。Path.relativize(Path other) このパスと指定されたパスとの間の相対パスを構築します。default Path指定されたパス文字列をPathに変換してから、resolveメソッドで指定されたとおりの方法で、このPathに対して解決します。指定されたパスをこのパスに対して解決します。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ファイル・アクセス権を設定します。Path.subpath(int beginIndex, int endIndex) このパスの名前要素のサブシーケンスである相対Pathを返します。Path.toAbsolutePath()このパスの絶対パスを表すPathオブジェクトを返します。Path.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のメソッド修飾子と型メソッド説明Files.find(Path start, int maxDepth, BiPredicate<Path, BasicFileAttributes> matcher, FileVisitOption... options) 指定された開始ファイルをルートとするファイル・ツリー内でファイルを検索することでPathが遅延設定されるStreamを返します。FileSystem.getRootDirectories()ルート・ディレクトリのパスを反復するためのオブジェクトを返します。Path.iterator()このパスの名前要素を処理するイテレータを返します。ディレクトリ内のエントリを要素に持つ遅延設定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を返します。Files.walk(Path start, int maxDepth, FileVisitOption... options) 指定された開始ファイルをルートとするファイル・ツリーを参照することでPathが遅延移入されるStreamを返します。Files.walk(Path start, FileVisitOption... options) 指定された開始ファイルをルートとするファイル・ツリーを参照することでPathが遅延移入されるStreamを返します。Path型のパラメータを持つjava.nio.fileのメソッド修飾子と型メソッド説明int2つの抽象パスを語彙的に比較します。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 voidファイルを削除します。static booleanFiles.deleteIfExists(Path path) ファイルが存在する場合は削除します。booleanこのパスが、指定されたパスで終わるかどうかをテストします。static booleanFiles.exists(Path path, LinkOption... options) ファイルが存在するかどうかをテストします。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 booleanファイルが隠しファイルとみなされるかどうかを判断します。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) ファイルが書込み可能かどうかをテストします。ファイル内のすべての行をStreamとして読み取ります。ファイル内のすべての行をStreamとして読み取ります。ディレクトリ内のエントリを要素に持つ遅延設定Streamを返します。boolean指定されたパスがこのマッチャのパターンに一致するかどうかを示します。static long2つのファイルのコンテンツ内で、最初の不一致バイトの位置を検索して返します。不一致がない場合は、-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) ファイルからすべてのバイトを読み取ります。Files.readAllLines(Path path) ファイルからすべての行を読み取ります。Files.readAllLines(Path path, Charset cs) ファイルからすべての行を読み取ります。static <A extends BasicFileAttributes>
AFiles.readAttributes(Path path, Class<A> type, LinkOption... options) 一括操作としてファイル属性を読み取ります。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) シンボリック・リンクのターゲットを読み取ります(オプションの操作)。Path.relativize(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 longファイルのサイズをバイトで返します。booleanPath.startsWith(Path other) このパスが、指定されたパスで始まるかどうかをテストします。Files.walk(Path start, int maxDepth, FileVisitOption... options) 指定された開始ファイルをルートとするファイル・ツリーを参照することでPathが遅延移入されるStreamを返します。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のメソッド・パラメータ修飾子と型メソッド説明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 Path指定されたURIを変換することによって、Pathオブジェクトを返します。FileSystemProvider.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 voidファイルを削除します。booleanFileSystemProvider.deleteIfExists(Path path) ファイルが存在する場合は削除します。booleanFileSystemProvider.exists(Path path, LinkOption... options) ファイルが存在するかどうかをテストします。abstract <V extends FileAttributeView>
VFileSystemProvider.getFileAttributeView(Path path, Class<V> type, LinkOption... options) 指定されたタイプのファイル属性ビューを返します。abstract FileStoreFileSystemProvider.getFileStore(Path path) ファイルが置かれているファイル・ストアを表すFileStoreを返します。abstract booleanファイルが隠しファイルとみなされるかどうかを判断します。abstract booleanFileSystemProvider.isSameFile(Path path, Path path2) 2つのパスが同じファイルを検出するかどうかを判断します。abstract voidFileSystemProvider.move(Path source, Path target, CopyOption... options) ファイルをターゲット・ファイルに移動するか、そのファイル名を変更します。FileSystemProvider.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を返します。FileSystemProvider.newFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) 読み取りまたは書き込み(あるいはその両方)用のファイルを開くか作成し、そのファイルにアクセスするためのファイル・チャネルを返します。FileSystemProvider.newFileSystem(Path path, Map<String, ?> env) ファイルの内容にファイル・システムとしてアクセスする新しいFileSystemを構築します。FileSystemProvider.newInputStream(Path path, OpenOption... options) ファイルを開き、そのファイルから読み取る入力ストリームを返します。FileSystemProvider.newOutputStream(Path path, OpenOption... options) ファイルを開くか作成して、そのファイルにバイトを書き込むために使用できる出力ストリームを返します。abstract StringFileTypeDetector.probeContentType(Path path) 指定されたファイルを調べてコンテンツ・タイプを推察します。abstract <A extends BasicFileAttributes>
AFileSystemProvider.readAttributes(Path path, Class<A> type, LinkOption... options) 一括操作としてファイル属性を読み取ります。FileSystemProvider.readAttributes(Path path, String attributes, LinkOption... options) 一括操作として一連のファイル属性を読み取ります。<A extends BasicFileAttributes>
AFileSystemProvider.readAttributesIfExists(Path path, Class<A> type, LinkOption... options) ファイルの属性が存在する場合、その属性を一括操作として読み取ります。FileSystemProvider.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の使用
パスを返すjavax.toolsのメソッド修飾子と型メソッド説明default PathStandardJavaFileManager.asPath(FileObject file) このファイル・オブジェクト(オプションの操作)の基礎をなすパス(存在する場合)を返します。パス文字列、またはパス文字列の結合時にパス文字列をパスに変換します。型パスの引数を持つ型を返すjavax.toolsのメソッド修飾子と型メソッド説明StandardJavaFileManager.getLocationAsPaths(JavaFileManager.Location location) 指定されたロケーションに関連付けられた検索パスを返します。型パスのパラメータを持つjavax.toolsのメソッド修飾子と型メソッド説明default Iterable<? extends JavaFileObject>StandardJavaFileManager.getJavaFileObjects(Path... paths) 指定されたパスを表すファイル・オブジェクトを返します。型パスの型引数を持つjavax.toolsのメソッド・パラメータ修飾子と型メソッド説明default Iterable<? extends JavaFileObject>StandardJavaFileManager.getJavaFileObjectsFromPaths(Iterable<? extends Path> paths) 非推奨。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の使用
修飾子と型メソッド説明Recording.getDestination()レコーディングが停止したときにレコーディング・データが書き込まれる宛先ファイルを返します。宛先が設定されていない場合はnullを返します。修飾子と型メソッド説明static Configurationファイルから構成を読み込みます。voidレコーディング・データをファイルに書き込みます。voidRecording.setDestination(Path destination) データがレコーディング停止時に書き込まれるロケーション、またはデータがダンプされない場合はnullを設定します。 -
jdk.jfr.consumerでのPathの使用
型パスのパラメータを持つjdk.jfr.consumerのメソッド修飾子と型メソッド説明voidレコーディング・データをファイルに書き込みます。static EventStreamファイルからイベント・ストリームを作成します。static EventStreamEventStream.openRepository(Path directory) ディスク・リポジトリからイベント・ストリームを作成します。static List<RecordedEvent>RecordingFile.readAllEvents(Path path) ファイル内のすべてのイベントのリストを返します。voidRecordingFile.write(Path destination, Predicate<RecordedEvent> filter) イベントをフィルタリングして新しいファイルに書き込みます。型パスのパラメータを持つjdk.jfr.consumerのコンストラクタ -
jdk.management.jfrでのPathの使用
型Pathのパラメータを持つjdk.management.jfrのメソッド型Pathのパラメータを持つjdk.management.jfrのコンストラクタ修飾子コンストラクタ説明RemoteRecordingStream(MBeanServerConnection connection, Path directory) FlightRecorderMXBeanが登録されているMBeanServerConnectionに対して演算するイベント・ストリームを作成します。
Pathで誤ってメソッドをコールする可能性をなくすには、StandardJavaFileManager.getJavaFileObjectsFromPaths(Collection)を使用します。