Package com.sun.jna.platform.linux
Class XAttrUtil
- java.lang.Object
-
- com.sun.jna.platform.linux.XAttrUtil
-
public abstract class XAttrUtil extends java.lang.ObjectUtility functions class for handling file extended attributes on Linux.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringfGetXAttr(int fd, java.lang.String name)Get extended attribute value.static java.lang.StringfGetXAttr(int fd, java.lang.String name, java.lang.String encoding)Get extended attribute value.static MemoryfGetXAttrAsMemory(int fd, java.lang.String name)Get extended attribute value.static byte[]fGetXAttrBytes(int fd, java.lang.String name)Get extended attribute value.static java.util.Collection<java.lang.String>fListXAttr(int fd)List extended attributes on file.static java.util.Collection<java.lang.String>fListXAttr(int fd, java.lang.String encoding)List extended attributes on file.static voidfRemoveXAttr(int fd, java.lang.String name)Remove extended attribute from file.static voidfSetXAttr(int fd, java.lang.String name, byte[] value)Set or replace value of extended attribute.static voidfSetXAttr(int fd, java.lang.String name, java.lang.String value)Set or replace value of extended attribute.static voidfSetXAttr(int fd, java.lang.String name, java.lang.String value, java.lang.String encoding)Set or replace value of extended attribute.static java.lang.StringgetXAttr(java.lang.String path, java.lang.String name)Get extended attribute value.static java.lang.StringgetXAttr(java.lang.String path, java.lang.String name, java.lang.String encoding)Get extended attribute value.static MemorygetXAttrAsMemory(java.lang.String path, java.lang.String name)Get extended attribute value.static byte[]getXAttrBytes(java.lang.String path, java.lang.String name)Get extended attribute value.static java.lang.StringlGetXAttr(java.lang.String path, java.lang.String name)Get extended attribute value but in case of symbolic link get the value from the link itself instead of linked file.static java.lang.StringlGetXAttr(java.lang.String path, java.lang.String name, java.lang.String encoding)Get extended attribute value but in case of symbolic link get the value from the link itself instead of linked file.static MemorylGetXAttrAsMemory(java.lang.String path, java.lang.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(java.lang.String path, java.lang.String name)Get extended attribute value but in case of symbolic link get the value from the link itself instead of linked file.static java.util.Collection<java.lang.String>listXAttr(java.lang.String path)List extended attributes on file.static java.util.Collection<java.lang.String>listXAttr(java.lang.String path, java.lang.String encoding)List extended attributes on file.static java.util.Collection<java.lang.String>lListXAttr(java.lang.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 java.util.Collection<java.lang.String>lListXAttr(java.lang.String path, java.lang.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(java.lang.String path, java.lang.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 voidlSetXAttr(java.lang.String path, java.lang.String name, byte[] value)Set or replace value of extended attribute but in case of symbolic link set the extended attribute on the link itself instead linked file.static voidlSetXAttr(java.lang.String path, java.lang.String name, java.lang.String value)Set or replace value of extended attribute but in case of symbolic link set the extended attribute on the link itself instead linked file.static voidlSetXAttr(java.lang.String path, java.lang.String name, java.lang.String value, java.lang.String encoding)Set 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(java.lang.String path, java.lang.String name)Remove extended attribute from file.static voidsetXAttr(java.lang.String path, java.lang.String name, byte[] value)Set or replace value of extended attribute.static voidsetXAttr(java.lang.String path, java.lang.String name, java.lang.String value)Set or replace value of extended attribute.static voidsetXAttr(java.lang.String path, java.lang.String name, java.lang.String value, java.lang.String encoding)Set or replace value of extended attribute.
-
-
-
Method Detail
-
setXAttr
public static void setXAttr(java.lang.String path, java.lang.String name, java.lang.String value) throws java.io.IOExceptionSet or replace value of extended attribute.- Parameters:
path- file pathname- extended attribute namevalue- value to set- Throws:
java.io.IOException- on any error
-
setXAttr
public static void setXAttr(java.lang.String path, java.lang.String name, java.lang.String value, java.lang.String encoding) throws java.io.IOExceptionSet 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:
java.io.IOException- on any error
-
setXAttr
public static void setXAttr(java.lang.String path, java.lang.String name, byte[] value) throws java.io.IOExceptionSet or replace value of extended attribute.- Parameters:
path- file pathname- extended attribute namevalue- value to set- Throws:
java.io.IOException- on any error
-
lSetXAttr
public static void lSetXAttr(java.lang.String path, java.lang.String name, java.lang.String value) throws java.io.IOExceptionSet 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:
java.io.IOException- on any error
-
lSetXAttr
public static void lSetXAttr(java.lang.String path, java.lang.String name, java.lang.String value, java.lang.String encoding) throws java.io.IOExceptionSet 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:
java.io.IOException- on any error
-
lSetXAttr
public static void lSetXAttr(java.lang.String path, java.lang.String name, byte[] value) throws java.io.IOExceptionSet 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:
java.io.IOException- on any error
-
fSetXAttr
public static void fSetXAttr(int fd, java.lang.String name, java.lang.String value) throws java.io.IOExceptionSet or replace value of extended attribute.- Parameters:
fd- file handlename- extended attribute namevalue- value to set- Throws:
java.io.IOException- on any error
-
fSetXAttr
public static void fSetXAttr(int fd, java.lang.String name, java.lang.String value, java.lang.String encoding) throws java.io.IOExceptionSet 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:
java.io.IOException- on any error
-
fSetXAttr
public static void fSetXAttr(int fd, java.lang.String name, byte[] value) throws java.io.IOExceptionSet or replace value of extended attribute.- Parameters:
fd- file handlename- extended attribute namevalue- value to set- Throws:
java.io.IOException- on any error
-
getXAttr
public static java.lang.String getXAttr(java.lang.String path, java.lang.String name) throws java.io.IOExceptionGet extended attribute value.- Parameters:
path- file pathname- extended attribute name- Returns:
- extended attribute value
- Throws:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
getXAttr
public static java.lang.String getXAttr(java.lang.String path, java.lang.String name, java.lang.String encoding) throws java.io.IOExceptionGet 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:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
getXAttrBytes
public static byte[] getXAttrBytes(java.lang.String path, java.lang.String name) throws java.io.IOExceptionGet extended attribute value.- Parameters:
path- file pathname- extended attribute name- Returns:
- extended attribute value
- Throws:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
getXAttrAsMemory
public static Memory getXAttrAsMemory(java.lang.String path, java.lang.String name) throws java.io.IOException
Get extended attribute value.- Parameters:
path- file pathname- extended attribute name- Returns:
- extended attribute value
- Throws:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
lGetXAttr
public static java.lang.String lGetXAttr(java.lang.String path, java.lang.String name) throws java.io.IOExceptionGet 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:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
lGetXAttr
public static java.lang.String lGetXAttr(java.lang.String path, java.lang.String name, java.lang.String encoding) throws java.io.IOExceptionGet 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:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
lGetXAttrBytes
public static byte[] lGetXAttrBytes(java.lang.String path, java.lang.String name) throws java.io.IOExceptionGet 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:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
lGetXAttrAsMemory
public static Memory lGetXAttrAsMemory(java.lang.String path, java.lang.String name) throws java.io.IOException
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:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
fGetXAttr
public static java.lang.String fGetXAttr(int fd, java.lang.String name) throws java.io.IOExceptionGet extended attribute value.- Parameters:
fd- file handlename- extended attribute name- Returns:
- extended attribute value
- Throws:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
fGetXAttr
public static java.lang.String fGetXAttr(int fd, java.lang.String name, java.lang.String encoding) throws java.io.IOExceptionGet 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:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
fGetXAttrBytes
public static byte[] fGetXAttrBytes(int fd, java.lang.String name) throws java.io.IOExceptionGet extended attribute value.- Parameters:
fd- file handlename- extended attribute name- Returns:
- extended attribute value
- Throws:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
fGetXAttrAsMemory
public static Memory fGetXAttrAsMemory(int fd, java.lang.String name) throws java.io.IOException
Get extended attribute value.- Parameters:
fd- file handlename- extended attribute name- Returns:
- extended attribute value
- Throws:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
listXAttr
public static java.util.Collection<java.lang.String> listXAttr(java.lang.String path) throws java.io.IOExceptionList extended attributes on file.- Parameters:
path- file path- Returns:
- collection of extended attributes' names
- Throws:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
listXAttr
public static java.util.Collection<java.lang.String> listXAttr(java.lang.String path, java.lang.String encoding) throws java.io.IOExceptionList extended attributes on file.- Parameters:
path- file pathencoding- character encoding use to decode extended attributes' names- Returns:
- collection of extended attributes' names
- Throws:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
lListXAttr
public static java.util.Collection<java.lang.String> lListXAttr(java.lang.String path) throws java.io.IOExceptionList 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:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
lListXAttr
public static java.util.Collection<java.lang.String> lListXAttr(java.lang.String path, java.lang.String encoding) throws java.io.IOExceptionList 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:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
fListXAttr
public static java.util.Collection<java.lang.String> fListXAttr(int fd) throws java.io.IOExceptionList extended attributes on file.- Parameters:
fd- file handle- Returns:
- collection of extended attributes' names
- Throws:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
fListXAttr
public static java.util.Collection<java.lang.String> fListXAttr(int fd, java.lang.String encoding) throws java.io.IOExceptionList extended attributes on file.- Parameters:
fd- file handleencoding- character encoding use to decode extended attributes' names- Returns:
- collection of extended attributes' names
- Throws:
java.io.IOException- on any error exceptERANGEwhich handled internally
-
removeXAttr
public static void removeXAttr(java.lang.String path, java.lang.String name) throws java.io.IOExceptionRemove extended attribute from file.- Parameters:
path- file pathname- extended attribute name- Throws:
java.io.IOException- on any error
-
lRemoveXAttr
public static void lRemoveXAttr(java.lang.String path, java.lang.String name) throws java.io.IOExceptionRemove 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:
java.io.IOException- on any error
-
fRemoveXAttr
public static void fRemoveXAttr(int fd, java.lang.String name) throws java.io.IOExceptionRemove extended attribute from file.- Parameters:
fd- file handlename- extended attribute name- Throws:
java.io.IOException- on any error
-
-