Skip navigation links
JNA API 5.6.0
com.sun.jna.platform.linux

Class XAttrUtil



  • public abstract class XAttrUtil
    extends java.lang.Object
    Utility functions class for handling file extended attributes on Linux.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.String fGetXAttr(int fd, java.lang.String name)
      Get extended attribute value.
      static java.lang.String fGetXAttr(int fd, java.lang.String name, java.lang.String encoding)
      Get extended attribute value.
      static Memory fGetXAttrAsMemory(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 void fRemoveXAttr(int fd, java.lang.String name)
      Remove extended attribute from file.
      static void fSetXAttr(int fd, java.lang.String name, byte[] value)
      Set or replace value of extended attribute.
      static void fSetXAttr(int fd, java.lang.String name, java.lang.String value)
      Set or replace value of extended attribute.
      static void fSetXAttr(int fd, java.lang.String name, java.lang.String value, java.lang.String encoding)
      Set or replace value of extended attribute.
      static java.lang.String getXAttr(java.lang.String path, java.lang.String name)
      Get extended attribute value.
      static java.lang.String getXAttr(java.lang.String path, java.lang.String name, java.lang.String encoding)
      Get extended attribute value.
      static Memory getXAttrAsMemory(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.String lGetXAttr(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.String lGetXAttr(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 Memory lGetXAttrAsMemory(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 void lRemoveXAttr(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 void lSetXAttr(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 void lSetXAttr(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 void lSetXAttr(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 void removeXAttr(java.lang.String path, java.lang.String name)
      Remove extended attribute from file.
      static void setXAttr(java.lang.String path, java.lang.String name, byte[] value)
      Set or replace value of extended attribute.
      static void setXAttr(java.lang.String path, java.lang.String name, java.lang.String value)
      Set or replace value of extended attribute.
      static void setXAttr(java.lang.String path, java.lang.String name, java.lang.String value, java.lang.String encoding)
      Set or replace value of extended attribute.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setXAttr

        public static void setXAttr(java.lang.String path,
                                    java.lang.String name,
                                    java.lang.String value)
                             throws java.io.IOException
        Set or replace value of extended attribute.
        Parameters:
        path - file path
        name - extended attribute name
        value - 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.IOException
        Set or replace value of extended attribute.
        Parameters:
        path - file path
        name - extended attribute name
        value - value to set
        encoding - 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.IOException
        Set or replace value of extended attribute.
        Parameters:
        path - file path
        name - extended attribute name
        value - 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.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 path
        name - extended attribute name
        value - 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.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 path
        name - extended attribute name
        value - value to set
        encoding - 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.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 path
        name - extended attribute name
        value - 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.IOException
        Set or replace value of extended attribute.
        Parameters:
        fd - file handle
        name - extended attribute name
        value - 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.IOException
        Set or replace value of extended attribute.
        Parameters:
        fd - file handle
        name - extended attribute name
        value - value to set
        encoding - 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.IOException
        Set or replace value of extended attribute.
        Parameters:
        fd - file handle
        name - extended attribute name
        value - 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.IOException
        Get extended attribute value.
        Parameters:
        path - file path
        name - extended attribute name
        Returns:
        extended attribute value
        Throws:
        java.io.IOException - on any error except ERANGE which handled internally
      • getXAttr

        public static java.lang.String getXAttr(java.lang.String path,
                                                java.lang.String name,
                                                java.lang.String encoding)
                                         throws java.io.IOException
        Get extended attribute value.
        Parameters:
        path - file path
        name - extended attribute name
        encoding - character encoding to be used to decode stored extended attribute value
        Returns:
        extended attribute value
        Throws:
        java.io.IOException - on any error except ERANGE which handled internally
      • getXAttrBytes

        public static byte[] getXAttrBytes(java.lang.String path,
                                           java.lang.String name)
                                    throws java.io.IOException
        Get extended attribute value.
        Parameters:
        path - file path
        name - extended attribute name
        Returns:
        extended attribute value
        Throws:
        java.io.IOException - on any error except ERANGE which 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 path
        name - extended attribute name
        Returns:
        extended attribute value
        Throws:
        java.io.IOException - on any error except ERANGE which handled internally
      • lGetXAttr

        public static java.lang.String lGetXAttr(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 path
        name - extended attribute name
        Returns:
        extended attribute value
        Throws:
        java.io.IOException - on any error except ERANGE which handled internally
      • lGetXAttr

        public static java.lang.String lGetXAttr(java.lang.String path,
                                                 java.lang.String name,
                                                 java.lang.String encoding)
                                          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 path
        name - extended attribute name
        encoding - character encoding to be used to decode stored extended attribute value
        Returns:
        extended attribute value
        Throws:
        java.io.IOException - on any error except ERANGE which handled internally
      • lGetXAttrBytes

        public static byte[] lGetXAttrBytes(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 path
        name - extended attribute name
        Returns:
        extended attribute value
        Throws:
        java.io.IOException - on any error except ERANGE which 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 path
        name - extended attribute name
        Returns:
        extended attribute value
        Throws:
        java.io.IOException - on any error except ERANGE which handled internally
      • fGetXAttr

        public static java.lang.String fGetXAttr(int fd,
                                                 java.lang.String name)
                                          throws java.io.IOException
        Get extended attribute value.
        Parameters:
        fd - file handle
        name - extended attribute name
        Returns:
        extended attribute value
        Throws:
        java.io.IOException - on any error except ERANGE which handled internally
      • fGetXAttr

        public static java.lang.String fGetXAttr(int fd,
                                                 java.lang.String name,
                                                 java.lang.String encoding)
                                          throws java.io.IOException
        Get extended attribute value.
        Parameters:
        fd - file handle
        name - extended attribute name
        encoding - character encoding to be used to decode stored extended attribute value
        Returns:
        extended attribute value
        Throws:
        java.io.IOException - on any error except ERANGE which handled internally
      • fGetXAttrBytes

        public static byte[] fGetXAttrBytes(int fd,
                                            java.lang.String name)
                                     throws java.io.IOException
        Get extended attribute value.
        Parameters:
        fd - file handle
        name - extended attribute name
        Returns:
        extended attribute value
        Throws:
        java.io.IOException - on any error except ERANGE which handled internally
      • fGetXAttrAsMemory

        public static Memory fGetXAttrAsMemory(int fd,
                                               java.lang.String name)
                                        throws java.io.IOException
        Get extended attribute value.
        Parameters:
        fd - file handle
        name - extended attribute name
        Returns:
        extended attribute value
        Throws:
        java.io.IOException - on any error except ERANGE which handled internally
      • listXAttr

        public static java.util.Collection<java.lang.String> listXAttr(java.lang.String path)
                                                                throws java.io.IOException
        List extended attributes on file.
        Parameters:
        path - file path
        Returns:
        collection of extended attributes' names
        Throws:
        java.io.IOException - on any error except ERANGE which handled internally
      • listXAttr

        public static java.util.Collection<java.lang.String> listXAttr(java.lang.String path,
                                                                       java.lang.String encoding)
                                                                throws java.io.IOException
        List extended attributes on file.
        Parameters:
        path - file path
        encoding - character encoding use to decode extended attributes' names
        Returns:
        collection of extended attributes' names
        Throws:
        java.io.IOException - on any error except ERANGE which handled internally
      • lListXAttr

        public static java.util.Collection<java.lang.String> lListXAttr(java.lang.String path)
                                                                 throws java.io.IOException
        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:
        java.io.IOException - on any error except ERANGE which handled internally
      • lListXAttr

        public static java.util.Collection<java.lang.String> lListXAttr(java.lang.String path,
                                                                        java.lang.String encoding)
                                                                 throws java.io.IOException
        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
        encoding - character encoding use to decode extended attributes' names
        Returns:
        collection of extended attributes' names
        Throws:
        java.io.IOException - on any error except ERANGE which handled internally
      • fListXAttr

        public static java.util.Collection<java.lang.String> fListXAttr(int fd)
                                                                 throws java.io.IOException
        List extended attributes on file.
        Parameters:
        fd - file handle
        Returns:
        collection of extended attributes' names
        Throws:
        java.io.IOException - on any error except ERANGE which handled internally
      • fListXAttr

        public static java.util.Collection<java.lang.String> fListXAttr(int fd,
                                                                        java.lang.String encoding)
                                                                 throws java.io.IOException
        List extended attributes on file.
        Parameters:
        fd - file handle
        encoding - character encoding use to decode extended attributes' names
        Returns:
        collection of extended attributes' names
        Throws:
        java.io.IOException - on any error except ERANGE which handled internally
      • removeXAttr

        public static void removeXAttr(java.lang.String path,
                                       java.lang.String name)
                                throws java.io.IOException
        Remove extended attribute from file.
        Parameters:
        path - file path
        name - 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.IOException
        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 path
        name - extended attribute name
        Throws:
        java.io.IOException - on any error
      • fRemoveXAttr

        public static void fRemoveXAttr(int fd,
                                        java.lang.String name)
                                 throws java.io.IOException
        Remove extended attribute from file.
        Parameters:
        fd - file handle
        name - extended attribute name
        Throws:
        java.io.IOException - on any error
JNA API 5.6.0

Copyright © 2007-2018 Timothy Wall. All Rights Reserved.