APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.internal.jrtfs

pack-priv final Class JrtFileAttributeView

extends Object
implements BasicFileAttributeView
Class Inheritance
All Implemented Interfaces
java.nio.file.attribute.BasicFileAttributeView, java.nio.file.attribute.FileAttributeView, java.nio.file.attribute.AttributeView
Imports
java.nio.file.LinkOption, java.nio.file.attribute.*, java.io.IOException, java.util.LinkedHashMap, .Map, .Objects

File attribute view for jrt file system.

Implementation Note

This class needs to maintain JDK 8 source compatibility. It is used internally in the JDK to implement jimage/jrtfs access, but also compiled and delivered as part of the jrtfs.jar to support access to the jimage file provided by the shipped JDK by tools running on JDK 8.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
private final boolean
private final LinkOption[]
private final JrtPath

Constructor Summary

AccessConstructor and Description
private
JrtFileAttributeView(JrtPath path, boolean isJrtView, LinkOption... options)

Method Summary

Modifier and TypeMethod and Description
pack-priv static Object
attribute(JrtFileAttributeView.AttrID id, JrtFileAttributes jrtfas, boolean isJrtView)

pack-priv static <V extends FileAttributeView> V
get(JrtPath path, Class<V> type, LinkOption... options)

pack-priv static JrtFileAttributeView
get(JrtPath path, String type, LinkOption... options)

public String
name()

Implements java.nio.file.attribute.BasicFileAttributeView.name.

Returns the name of the attribute view.

public JrtFileAttributes
readAttributes()

Implements java.nio.file.attribute.BasicFileAttributeView.readAttributes.

Reads the basic file attributes as a bulk operation.

pack-priv static Map<String, Object>
readAttributes(JrtPath path, String attributes, LinkOption... options)

pack-priv static void
setAttribute(JrtPath path, String attribute, Object value)

public void
setTimes(FileTime lastModifiedTime, FileTime lastAccessTime, FileTime createTime)

Implements java.nio.file.attribute.BasicFileAttributeView.setTimes.

Updates any or all of the file's last modified time, last access time, and create time attributes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

isJrtViewback to summary
private final boolean isJrtView
optionsback to summary
private final LinkOption[] options
pathback to summary
private final JrtPath path

Constructor Detail

JrtFileAttributeViewback to summary
private JrtFileAttributeView(JrtPath path, boolean isJrtView, LinkOption... options)

Method Detail

attributeback to summary
pack-priv static Object attribute(JrtFileAttributeView.AttrID id, JrtFileAttributes jrtfas, boolean isJrtView)
getback to summary
pack-priv static <V extends FileAttributeView> V get(JrtPath path, Class<V> type, LinkOption... options)
Annotations
@SuppressWarnings:unchecked
getback to summary
pack-priv static JrtFileAttributeView get(JrtPath path, String type, LinkOption... options)
nameback to summary
public String name()

Implements java.nio.file.attribute.BasicFileAttributeView.name.

Doc from java.nio.file.attribute.BasicFileAttributeView.name.

Returns the name of the attribute view. Attribute views of this type have the name "basic".

Annotations
@Override
readAttributesback to summary
public JrtFileAttributes readAttributes() throws IOException

Implements java.nio.file.attribute.BasicFileAttributeView.readAttributes.

Doc from java.nio.file.attribute.BasicFileAttributeView.readAttributes.

Reads the basic file attributes as a bulk operation.

It is implementation specific if all file attributes are read as an atomic operation with respect to other file system operations.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
readAttributesback to summary
pack-priv static Map<String, Object> readAttributes(JrtPath path, String attributes, LinkOption... options) throws IOException
setAttributeback to summary
pack-priv static void setAttribute(JrtPath path, String attribute, Object value) throws IOException
setTimesback to summary
public void setTimes(FileTime lastModifiedTime, FileTime lastAccessTime, FileTime createTime) throws IOException

Implements java.nio.file.attribute.BasicFileAttributeView.setTimes.

Doc from java.nio.file.attribute.BasicFileAttributeView.setTimes.

Updates any or all of the file's last modified time, last access time, and create time attributes.

This method updates the file's timestamp attributes. The values are converted to the epoch and precision supported by the file system. Converting from finer to coarser granularities results in precision loss. The behavior of this method when attempting to set a timestamp that is not supported or to a value that is outside the range supported by the underlying file store is not defined. It may or not fail by throwing an IOException.

If any of the lastModifiedTime, lastAccessTime, or createTime parameters has the value null then the corresponding timestamp is not changed. An implementation may require to read the existing values of the file attributes when only some, but not all, of the timestamp attributes are updated. Consequently, this method may not be an atomic operation with respect to other file system operations. Reading and re-writing existing values may also result in precision loss. If all of the lastModifiedTime, lastAccessTime and createTime parameters are null then this method has no effect.

Usage Example: Suppose we want to change a file's last access time.

Path path = ... FileTime time = ... Files.getFileAttributeView(path, BasicFileAttributeView.class).setTimes(null, time, null);
Path path = ...
FileTime time = ...
Files.getFileAttributeView(path, BasicFileAttributeView.class).setTimes(null, time, null);
Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
jdk.internal.jrtfs back to summary

private final Enum JrtFileAttributeView.AttrID

extends Enum<JrtFileAttributeView.AttrID>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final JrtFileAttributeView.AttrID
public static final JrtFileAttributeView.AttrID
public static final JrtFileAttributeView.AttrID
public static final JrtFileAttributeView.AttrID
public static final JrtFileAttributeView.AttrID
public static final JrtFileAttributeView.AttrID
public static final JrtFileAttributeView.AttrID
public static final JrtFileAttributeView.AttrID
public static final JrtFileAttributeView.AttrID
public static final JrtFileAttributeView.AttrID
public static final JrtFileAttributeView.AttrID

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static JrtFileAttributeView.AttrID
public static JrtFileAttributeView.AttrID[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

compressedSizeback to summary
public static final JrtFileAttributeView.AttrID compressedSize
creationTimeback to summary
public static final JrtFileAttributeView.AttrID creationTime
extensionback to summary
public static final JrtFileAttributeView.AttrID extension
fileKeyback to summary
public static final JrtFileAttributeView.AttrID fileKey
isDirectoryback to summary
public static final JrtFileAttributeView.AttrID isDirectory
isOtherback to summary
public static final JrtFileAttributeView.AttrID isOther
isRegularFileback to summary
public static final JrtFileAttributeView.AttrID isRegularFile
lastAccessTimeback to summary
public static final JrtFileAttributeView.AttrID lastAccessTime
lastModifiedTimeback to summary
public static final JrtFileAttributeView.AttrID lastModifiedTime
sizeback to summary
public static final JrtFileAttributeView.AttrID size

Constructor Detail

AttrIDback to summary
private AttrID()

Method Detail

valueOfback to summary
public static JrtFileAttributeView.AttrID valueOf(String name)
valuesback to summary
public static JrtFileAttributeView.AttrID[] values()