クラス
java.nio.file.LinkOptionの使用
パッケージ | 説明 |
---|---|
java.nio.file |
ファイル、ファイル属性、およびファイル・システムにアクセスするためのJava仮想マシン用のインタフェースとクラスを定義します。
|
java.nio.file.spi |
java.nio.file パッケージのサービス・プロバイダ・クラス。 |
-
java.nio.fileでのLinkOptionの使用
LinkOptionを返すjava.nio.fileのメソッド 修飾子と型 メソッド 説明 static LinkOption
LinkOption. valueOf(String name)
指定された名前を持つ、この型の列挙型定数を返します。static LinkOption[]
LinkOption. values()
この列挙型の定数を含む配列を、宣言されている順序で返します。LinkOption型のパラメータを持つjava.nio.fileのメソッド 修飾子と型 メソッド 説明 static boolean
Files. exists(Path path, LinkOption... options)
ファイルが存在するかどうかをテストします。static Object
Files. getAttribute(Path path, String attribute, LinkOption... options)
ファイル属性の値を読み取ります。static <V extends FileAttributeView>
VFiles. getFileAttributeView(Path path, Class<V> type, LinkOption... options)
指定されたタイプのファイル属性ビューを返します。<V extends FileAttributeView>
VSecureDirectoryStream. getFileAttributeView(T path, Class<V> type, LinkOption... options)
このディレクトリ内のファイルのファイル属性にアクセスするための新しいファイル属性ビューを返します。static FileTime
Files. getLastModifiedTime(Path path, LinkOption... options)
ファイルの最終変更時間を返します。static UserPrincipal
Files. getOwner(Path path, LinkOption... options)
ファイルの所有者を返します。static Set<PosixFilePermission>
Files. getPosixFilePermissions(Path path, LinkOption... options)
ファイルのPOSIXファイル・アクセス権を返します。static boolean
Files. isDirectory(Path path, LinkOption... options)
ファイルがディレクトリかどうかをテストします。static boolean
Files. isRegularFile(Path path, LinkOption... options)
ファイルが不透明な内容の通常ファイルかどうかをテストします。SecureDirectoryStream<T>
SecureDirectoryStream. newDirectoryStream(T path, LinkOption... options)
指定されたパスによって識別されるディレクトリを開き、そのディレクトリ内のエントリを反復処理するSecureDirectoryStream
を返します。static boolean
Files. notExists(Path path, LinkOption... options)
このパスが示すファイルが存在しないかどうかをテストします。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 Path
Files. setAttribute(Path path, String attribute, Object value, LinkOption... options)
ファイル属性の値を設定します。Path
Path. toRealPath(LinkOption... options)
既存のファイルの実際のパスを返します。 -
java.nio.file.spiでのLinkOptionの使用
LinkOption型のパラメータを持つjava.nio.file.spiのメソッド 修飾子と型 メソッド 説明 abstract <V extends FileAttributeView>
VFileSystemProvider. getFileAttributeView(Path path, Class<V> type, LinkOption... options)
指定されたタイプのファイル属性ビューを返します。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)
一括操作として一連のファイル属性を読み取ります。abstract void
FileSystemProvider. setAttribute(Path path, String attribute, Object value, LinkOption... options)
ファイル属性の値を設定します。