Package com.sun.jna.platform.linux
Class XAttrUtil
java.lang.Object
com.sun.jna.platform.linux.XAttrUtil
Utility functions class for handling file extended attributes on Linux.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringGet extended attribute value.static StringGet extended attribute value.static MemoryfGetXAttrAsMemory(int fd, String name) Get extended attribute value.static byte[]fGetXAttrBytes(int fd, String name) Get extended attribute value.static Collection<String>fListXAttr(int fd) List extended attributes on file.static Collection<String>fListXAttr(int fd, String encoding) List extended attributes on file.static voidfRemoveXAttr(int fd, String name) Remove extended attribute from file.static voidSet or replace value of extended attribute.static voidSet or replace value of extended attribute.static voidSet or replace value of extended attribute.static StringGet extended attribute value.static StringGet extended attribute value.static MemorygetXAttrAsMemory(String path, String name) Get extended attribute value.static byte[]getXAttrBytes(String path, String name) Get extended attribute value.static StringGet extended attribute value but in case of symbolic link get the value from the link itself instead of linked file.static StringGet extended attribute value but in case of symbolic link get the value from the link itself instead of linked file.static MemorylGetXAttrAsMemory(String path, String name) Get extended attribute value but in case of symbolic link get the value from the link itself instead of linked file.static byte[]lGetXAttrBytes(String path, String name) Get extended attribute value but in case of symbolic link get the value from the link itself instead of linked file.static Collection<String>List extended attributes on file.static Collection<String>List extended attributes on file.static Collection<String>lListXAttr(String path) List extended attributes on file but in case of symbolic link get extended attributes of the link itself instead of linked file.static Collection<String>lListXAttr(String path, String encoding) List extended attributes on file but in case of symbolic link get extended attributes of the link itself instead of linked file.static voidlRemoveXAttr(String path, String name) Remove extended attribute from file but in case of symbolic link remove extended attribute from the link itself instead of linked file.static voidSet or replace value of extended attribute but in case of symbolic link set the extended attribute on the link itself instead linked file.static voidSet or replace value of extended attribute but in case of symbolic link set the extended attribute on the link itself instead linked file.static voidSet or replace value of extended attribute but in case of symbolic link set the extended attribute on the link itself instead linked file.static voidremoveXAttr(String path, String name) Remove extended attribute from file.static voidSet or replace value of extended attribute.static voidSet or replace value of extended attribute.static voidSet or replace value of extended attribute.
-
Method Details
-
setXAttr
Set or replace value of extended attribute.- Parameters:
path- file pathname- extended attribute namevalue- value to set- Throws:
IOException- on any error
-
setXAttr
public static void setXAttr(String path, String name, String value, String encoding) throws IOException Set or replace value of extended attribute.- Parameters:
path- file pathname- extended attribute namevalue- value to setencoding- character encoding to be used for stored value- Throws:
IOException- on any error
-
setXAttr
Set or replace value of extended attribute.- Parameters:
path- file pathname- extended attribute namevalue- value to set- Throws:
IOException- on any error
-
lSetXAttr
Set or replace value of extended attribute but in case of symbolic link set the extended attribute on the link itself instead linked file.- Parameters:
path- file pathname- extended attribute namevalue- value to set- Throws:
IOException- on any error
-
lSetXAttr
public static void lSetXAttr(String path, String name, String value, String encoding) throws IOException Set or replace value of extended attribute but in case of symbolic link set the extended attribute on the link itself instead linked file.- Parameters:
path- file pathname- extended attribute namevalue- value to setencoding- character encoding to be used for stored value- Throws:
IOException- on any error
-
lSetXAttr
Set or replace value of extended attribute but in case of symbolic link set the extended attribute on the link itself instead linked file.- Parameters:
path- file pathname- extended attribute namevalue- value to set- Throws:
IOException- on any error
-
fSetXAttr
Set or replace value of extended attribute.- Parameters:
fd- file handlename- extended attribute namevalue- value to set- Throws:
IOException- on any error
-
fSetXAttr
Set or replace value of extended attribute.- Parameters:
fd- file handlename- extended attribute namevalue- value to setencoding- character encoding to be used for stored value- Throws:
IOException- on any error
-
fSetXAttr
Set or replace value of extended attribute.- Parameters:
fd- file handlename- extended attribute namevalue- value to set- Throws:
IOException- on any error
-
getXAttr
Get extended attribute value.- Parameters:
path- file pathname- extended attribute name- Returns:
- extended attribute value
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
getXAttr
Get extended attribute value.- Parameters:
path- file pathname- extended attribute nameencoding- character encoding to be used to decode stored extended attribute value- Returns:
- extended attribute value
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
getXAttrBytes
Get extended attribute value.- Parameters:
path- file pathname- extended attribute name- Returns:
- extended attribute value
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
getXAttrAsMemory
Get extended attribute value.- Parameters:
path- file pathname- extended attribute name- Returns:
- extended attribute value
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
lGetXAttr
Get extended attribute value but in case of symbolic link get the value from the link itself instead of linked file.- Parameters:
path- file pathname- extended attribute name- Returns:
- extended attribute value
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
lGetXAttr
Get extended attribute value but in case of symbolic link get the value from the link itself instead of linked file.- Parameters:
path- file pathname- extended attribute nameencoding- character encoding to be used to decode stored extended attribute value- Returns:
- extended attribute value
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
lGetXAttrBytes
Get extended attribute value but in case of symbolic link get the value from the link itself instead of linked file.- Parameters:
path- file pathname- extended attribute name- Returns:
- extended attribute value
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
lGetXAttrAsMemory
Get extended attribute value but in case of symbolic link get the value from the link itself instead of linked file.- Parameters:
path- file pathname- extended attribute name- Returns:
- extended attribute value
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
fGetXAttr
Get extended attribute value.- Parameters:
fd- file handlename- extended attribute name- Returns:
- extended attribute value
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
fGetXAttr
Get extended attribute value.- Parameters:
fd- file handlename- extended attribute nameencoding- character encoding to be used to decode stored extended attribute value- Returns:
- extended attribute value
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
fGetXAttrBytes
Get extended attribute value.- Parameters:
fd- file handlename- extended attribute name- Returns:
- extended attribute value
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
fGetXAttrAsMemory
Get extended attribute value.- Parameters:
fd- file handlename- extended attribute name- Returns:
- extended attribute value
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
listXAttr
List extended attributes on file.- Parameters:
path- file path- Returns:
- collection of extended attributes' names
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
listXAttr
List extended attributes on file.- Parameters:
path- file pathencoding- character encoding use to decode extended attributes' names- Returns:
- collection of extended attributes' names
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
lListXAttr
List extended attributes on file but in case of symbolic link get extended attributes of the link itself instead of linked file.- Parameters:
path- file path- Returns:
- collection of extended attributes' names
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
lListXAttr
List extended attributes on file but in case of symbolic link get extended attributes of the link itself instead of linked file.- Parameters:
path- file pathencoding- character encoding use to decode extended attributes' names- Returns:
- collection of extended attributes' names
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
fListXAttr
List extended attributes on file.- Parameters:
fd- file handle- Returns:
- collection of extended attributes' names
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
fListXAttr
List extended attributes on file.- Parameters:
fd- file handleencoding- character encoding use to decode extended attributes' names- Returns:
- collection of extended attributes' names
- Throws:
IOException- on any error exceptERANGEwhich handled internally
-
removeXAttr
Remove extended attribute from file.- Parameters:
path- file pathname- extended attribute name- Throws:
IOException- on any error
-
lRemoveXAttr
Remove extended attribute from file but in case of symbolic link remove extended attribute from the link itself instead of linked file.- Parameters:
path- file pathname- extended attribute name- Throws:
IOException- on any error
-
fRemoveXAttr
Remove extended attribute from file.- Parameters:
fd- file handlename- extended attribute name- Throws:
IOException- on any error
-