| Modifier and Type | Field and Description |
|---|---|
| private final UnixPath | |
| private final boolean | |
| private static final int | |
| private static final int | |
| private static final JavaNioAccess | |
| private static final Unsafe | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private static List | |
| private static void | |
| pack-priv static void | copyExtendedAttributes(int
file descriptor for source file ofd, int file descriptor for target file nfd)Used by copyTo/moveTo to copy extended attributes from source to target. |
| public void | delete(String name)
Implements java. Deletes a user-defined attribute. |
| private static List | |
| public List | list()
Implements java. Returns a list containing the names of the user-defined attributes. |
| protected abstract int | |
| private byte[] | |
| public int | read(String name, ByteBuffer dst)
Implements java. Read the value of a user-defined attribute into a buffer. |
| private int | |
| public int | size(String name)
Implements java. Returns the size of the value of a user-defined attribute. |
| public int | write(String name, ByteBuffer src)
Implements java. Writes the value of a user-defined attribute from a buffer. |
| private void |
| file | back to summary |
|---|---|
| private final UnixPath file | |
| followLinks | back to summary |
|---|---|
| private final boolean followLinks | |
| MAX_LISTXATTR_BUF_SIZE | back to summary |
|---|---|
| private static final int MAX_LISTXATTR_BUF_SIZE | |
| MIN_LISTXATTR_BUF_SIZE | back to summary |
|---|---|
| private static final int MIN_LISTXATTR_BUF_SIZE | |
| NIO_ACCESS | back to summary |
|---|---|
| private static final JavaNioAccess NIO_ACCESS | |
| unsafe | back to summary |
|---|---|
| private static final Unsafe unsafe | |
| USER_NAMESPACE | back to summary |
|---|---|
| private static final String USER_NAMESPACE | |
| UnixUserDefinedFileAttributeView | back to summary |
|---|---|
| pack-priv UnixUserDefinedFileAttributeView(UnixPath file, boolean followLinks) | |
| asList | back to summary |
|---|---|
| private static List | |
| copyExtendedAttribute | back to summary |
|---|---|
| private static void copyExtendedAttribute(int ofd, byte[] name, int nfd) throws UnixException | |
| copyExtendedAttributes | back to summary |
|---|---|
| pack-priv static void copyExtendedAttributes(int ofd, int nfd) Used by copyTo/moveTo to copy extended attributes from source to target.
| |
| delete | back to summary |
|---|---|
| public void delete(String name) throws IOException Implements java. Doc from java. Deletes a user-defined attribute.
| |
| list | back to summary |
|---|---|
| private static List | |
| list | back to summary |
|---|---|
| public List Implements java. Doc from java. Returns a list containing the names of the user-defined attributes.
| |
| maxNameLength | back to summary |
|---|---|
protected abstract int maxNameLength()
| |
| nameAsBytes | back to summary |
|---|---|
| private byte[] nameAsBytes(UnixPath file, String name) throws IOException | |
| read | back to summary |
|---|---|
| public int read(String name, ByteBuffer dst) throws IOException Implements java. Doc from java. Read the value of a user-defined attribute into a buffer. This method reads the value of the attribute into the given buffer
as a sequence of bytes, failing if the number of bytes remaining in
the buffer is insufficient to read the complete attribute value. The
number of bytes transferred into the buffer is Usage Example:
Suppose we want to read a file's MIME type that is stored as a user-defined
attribute with the name " UserDefinedFileAttributeView view = Files.getFileAttributeView(path, UserDefinedFileAttributeView.class); String name = "user.mimetype"; ByteBuffer buf = ByteBuffer.allocate(view.size(name)); view.read(name, buf); buf.flip(); String value = Charset.defaultCharset().decode(buf).toString();
| |
| read | back to summary |
|---|---|
| private int read(String name, long address, int rem) throws IOException | |
| size | back to summary |
|---|---|
| public int size(String name) throws IOException Implements java. Doc from java. Returns the size of the value of a user-defined attribute.
| |
| write | back to summary |
|---|---|
| public int write(String name, ByteBuffer src) throws IOException Implements java. Doc from java. Writes the value of a user-defined attribute from a buffer. This method writes the value of the attribute from a given buffer as
a sequence of bytes. The size of the value to transfer is If an attribute of the given name already exists then its value is replaced. If the attribute does not exist then it is created. It is implementation specific if a test to check for the existence of the attribute and the creation of attribute are atomic with respect to other file system activities. Where there is insufficient space to store the attribute, or the
attribute name or value exceed an implementation specific maximum size
then an Usage Example: Suppose we want to write a file's MIME type as a user-defined attribute: UserDefinedFileAttributeView view = Files.getFileAttributeView(path, UserDefinedFileAttributeView.class); view.write("user.mimetype", Charset.defaultCharset().encode("text/html"));
| |
| write | back to summary |
|---|---|
| private void write(String name, long address, int rem) throws IOException | |