APIdia Launch Partner
Top Inners Constructors Methods
sun.nio.fs

pack-priv Class UnixFileAttributeViews

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.file.*, java.nio.file.attribute.*, java.util.*, java.util.concurrent.TimeUnit

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
pack-priv static class

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static UnixFileAttributeViews.Basic
createBasicView(UnixPath file, boolean followLinks)

pack-priv static FileOwnerAttributeViewImpl
createOwnerView(UnixPath file, boolean followLinks)

pack-priv static UnixFileAttributeViews.Posix
createPosixView(UnixPath file, boolean followLinks)

pack-priv static UnixFileAttributeViews.Unix
createUnixView(UnixPath file, boolean followLinks)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

UnixFileAttributeViewsback to summary
pack-priv UnixFileAttributeViews()

Method Detail

createBasicViewback to summary
pack-priv static UnixFileAttributeViews.Basic createBasicView(UnixPath file, boolean followLinks)
createOwnerViewback to summary
pack-priv static FileOwnerAttributeViewImpl createOwnerView(UnixPath file, boolean followLinks)
createPosixViewback to summary
pack-priv static UnixFileAttributeViews.Posix createPosixView(UnixPath file, boolean followLinks)
createUnixViewback to summary
pack-priv static UnixFileAttributeViews.Unix createUnixView(UnixPath file, boolean followLinks)
sun.nio.fs back to summary

pack-priv Class UnixFileAttributeViews.Basic

extends AbstractBasicFileAttributeView
Class Inheritance
Known Direct Subclasses
sun.nio.fs.UnixFileAttributeViews.Posix, sun.nio.fs.LinuxDosFileAttributeView

Field Summary

Modifier and TypeField and Description
protected final UnixPath
protected final boolean
Inherited from sun.nio.fs.AbstractBasicFileAttributeView:
basicAttributeNames

Constructor Summary

AccessConstructor and Description
pack-priv
Basic(UnixPath file, boolean followLinks)

Method Summary

Modifier and TypeMethod and Description
public BasicFileAttributes
readAttributes()

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

Reads the basic file attributes as a bulk operation.

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 sun.nio.fs.AbstractBasicFileAttributeView:
addRequestedBasicAttributesnamereadAttributessetAttribute

Field Detail

fileback to summary
protected final UnixPath file

Constructor Detail

Basicback to summary
pack-priv Basic(UnixPath file, boolean followLinks)

Method Detail

readAttributesback to summary
public BasicFileAttributes 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
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
sun.nio.fs back to summary

pack-priv Class UnixFileAttributeViews.Posix

extends Basic
implements PosixFileAttributeView
Class Inheritance
All Implemented Interfaces
java.nio.file.attribute.PosixFileAttributeView, java.nio.file.attribute.FileOwnerAttributeView, java.nio.file.attribute.FileAttributeView, java.nio.file.attribute.AttributeView, java.nio.file.attribute.BasicFileAttributeView
Known Direct Subclasses
sun.nio.fs.UnixFileAttributeViews.Unix

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final String
pack-priv static final Set<String>
Inherited from sun.nio.fs.UnixFileAttributeViews.Basic:
filefollowLinks

Constructor Summary

AccessConstructor and Description
pack-priv
Posix(UnixPath file, boolean followLinks)

Method Summary

Modifier and TypeMethod and Description
pack-priv final void
addRequestedPosixAttributes(PosixFileAttributes attrs, AbstractBasicFileAttributeView.AttributesBuilder builder)

Invoked by readAttributes or sub-classes to add all matching posix attributes to the builder

public UserPrincipal
public String
public Map<String, Object>
readAttributes(String[] requested)

Overrides sun.nio.fs.AbstractBasicFileAttributeView.readAttributes.

Implements sun.nio.fs.DynamicFileAttributeView.readAttributes.

Reads a set of file attributes as a bulk operation.

public UnixFileAttributes
public void
setAttribute(String attribute, Object value)

Overrides sun.nio.fs.AbstractBasicFileAttributeView.setAttribute.

Implements sun.nio.fs.DynamicFileAttributeView.setAttribute.

Sets/updates the value of an attribute.

public void
pack-priv final void
setMode(int mode)

public void
pack-priv final void
setOwners(int uid, int gid)

public void
Inherited from sun.nio.fs.UnixFileAttributeViews.Basic:
setTimes

Field Detail

GROUP_NAMEback to summary
private static final String GROUP_NAME
OWNER_NAMEback to summary
private static final String OWNER_NAME
PERMISSIONS_NAMEback to summary
private static final String PERMISSIONS_NAME
posixAttributeNamesback to summary
pack-priv static final Set<String> posixAttributeNames

Constructor Detail

Posixback to summary
pack-priv Posix(UnixPath file, boolean followLinks)

Method Detail

addRequestedPosixAttributesback to summary
pack-priv final void addRequestedPosixAttributes(PosixFileAttributes attrs, AbstractBasicFileAttributeView.AttributesBuilder builder)

Invoked by readAttributes or sub-classes to add all matching posix attributes to the builder

getOwnerback to summary
public UserPrincipal getOwner() throws IOException

Implements java.nio.file.attribute.FileOwnerAttributeView.getOwner.

Doc from java.nio.file.attribute.FileOwnerAttributeView.getOwner.

Read the file owner.

It is implementation specific if the file owner can be a group.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
nameback to summary
public String name()

Overrides sun.nio.fs.AbstractBasicFileAttributeView.name.

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

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

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

Annotations
@Override
readAttributesback to summary
public Map<String, Object> readAttributes(String[] requested) throws IOException

Overrides sun.nio.fs.AbstractBasicFileAttributeView.readAttributes.

Implements sun.nio.fs.DynamicFileAttributeView.readAttributes.

Doc from sun.nio.fs.DynamicFileAttributeView.readAttributes.

Reads a set of file attributes as a bulk operation.

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

Overrides sun.nio.fs.UnixFileAttributeViews.Basic.readAttributes.

Implements java.nio.file.attribute.PosixFileAttributeView.readAttributes, 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:

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

if an I/O error occurs

setAttributeback to summary
public void setAttribute(String attribute, Object value) throws IOException

Overrides sun.nio.fs.AbstractBasicFileAttributeView.setAttribute.

Implements sun.nio.fs.DynamicFileAttributeView.setAttribute.

Doc from sun.nio.fs.DynamicFileAttributeView.setAttribute.

Sets/updates the value of an attribute.

Annotations
@Override
@SuppressWarnings:unchecked
setGroupback to summary
public void setGroup(GroupPrincipal group) throws IOException

Implements java.nio.file.attribute.PosixFileAttributeView.setGroup.

Doc from java.nio.file.attribute.PosixFileAttributeView.setGroup.

Updates the file group-owner.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
setModeback to summary
pack-priv final void setMode(int mode) throws IOException
setOwnerback to summary
public void setOwner(UserPrincipal owner) throws IOException

Implements java.nio.file.attribute.FileOwnerAttributeView.setOwner.

Doc from java.nio.file.attribute.FileOwnerAttributeView.setOwner.

Updates the file owner.

It is implementation specific if the file owner can be a group. To ensure consistent and correct behavior across platforms it is recommended that this method should only be used to set the file owner to a user principal that is not a group.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs, or the owner parameter is a group and this implementation does not support setting the owner to a group
setOwnersback to summary
pack-priv final void setOwners(int uid, int gid) throws IOException
setPermissionsback to summary
public void setPermissions(Set<PosixFilePermission> perms) throws IOException

Implements java.nio.file.attribute.PosixFileAttributeView.setPermissions.

Doc from java.nio.file.attribute.PosixFileAttributeView.setPermissions.

Updates the file permissions.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
sun.nio.fs back to summary

pack-priv Class UnixFileAttributeViews.Unix

extends Posix
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
pack-priv static final Set<String>
Inherited from sun.nio.fs.UnixFileAttributeViews.Posix:
posixAttributeNames

Constructor Summary

AccessConstructor and Description
pack-priv
Unix(UnixPath file, boolean followLinks)

Method Summary

Modifier and TypeMethod and Description
public String
public Map<String, Object>
readAttributes(String[] requested)

Overrides sun.nio.fs.UnixFileAttributeViews.Posix.readAttributes.

Implements sun.nio.fs.DynamicFileAttributeView.readAttributes.

Reads a set of file attributes as a bulk operation.

public void
setAttribute(String attribute, Object value)

Overrides sun.nio.fs.UnixFileAttributeViews.Posix.setAttribute.

Implements sun.nio.fs.DynamicFileAttributeView.setAttribute.

Sets/updates the value of an attribute.

Inherited from sun.nio.fs.UnixFileAttributeViews.Posix:
addRequestedPosixAttributesgetOwnerreadAttributessetGroupsetModesetOwnersetOwnerssetPermissions

Field Detail

CTIME_NAMEback to summary
private static final String CTIME_NAME
DEV_NAMEback to summary
private static final String DEV_NAME
GID_NAMEback to summary
private static final String GID_NAME
INO_NAMEback to summary
private static final String INO_NAME
MODE_NAMEback to summary
private static final String MODE_NAME
RDEV_NAMEback to summary
private static final String RDEV_NAME
UID_NAMEback to summary
private static final String UID_NAME
unixAttributeNamesback to summary
pack-priv static final Set<String> unixAttributeNames

Constructor Detail

Unixback to summary
pack-priv Unix(UnixPath file, boolean followLinks)

Method Detail

nameback to summary
public String name()

Overrides sun.nio.fs.UnixFileAttributeViews.Posix.name.

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

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

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

Annotations
@Override
readAttributesback to summary
public Map<String, Object> readAttributes(String[] requested) throws IOException

Overrides sun.nio.fs.UnixFileAttributeViews.Posix.readAttributes.

Implements sun.nio.fs.DynamicFileAttributeView.readAttributes.

Doc from sun.nio.fs.DynamicFileAttributeView.readAttributes.

Reads a set of file attributes as a bulk operation.

Annotations
@Override
setAttributeback to summary
public void setAttribute(String attribute, Object value) throws IOException

Overrides sun.nio.fs.UnixFileAttributeViews.Posix.setAttribute.

Implements sun.nio.fs.DynamicFileAttributeView.setAttribute.

Doc from sun.nio.fs.DynamicFileAttributeView.setAttribute.

Sets/updates the value of an attribute.

Annotations
@Override