Class PosixViewAttributeAction

  • All Implemented Interfaces:
    java.lang.Runnable, Action

    @Plugin(name="PosixViewAttribute",
            category="Core",
            printObject=true)
    public class PosixViewAttributeAction
    extends AbstractPathAction
    File posix attribute view action. Allow to define file permissions, user and group for log files on posix supported OS.
    • Method Detail

      • createFileVisitor

        protected java.nio.file.FileVisitor<java.nio.file.Path> createFileVisitor​(java.nio.file.Path basePath,
                                                                                  java.util.List<PathCondition> conditions)
        Description copied from class: AbstractPathAction
        Creates a new FileVisitor<Path> to pass to the Files.walkFileTree(Path, Set, int, FileVisitor) method when the AbstractPathAction.execute() method is invoked.

        The visitor is responsible for processing the files it encounters that are accepted by all filters.

        Specified by:
        createFileVisitor in class AbstractPathAction
        Parameters:
        basePath - base dir from where to start scanning for files to process
        conditions - filters that determine if a file should be processed
        Returns:
        a new FileVisitor<Path>
      • getFilePermissions

        public java.util.Set<java.nio.file.attribute.PosixFilePermission> getFilePermissions()
        Returns posix file permissions if defined and the OS supports posix file attribute, null otherwise.
        Returns:
        File posix permissions
        See Also:
        PosixFileAttributeView
      • getFileOwner

        public java.lang.String getFileOwner()
        Returns file owner if defined and the OS supports owner file attribute view, null otherwise.
        Returns:
        File owner
        See Also:
        FileOwnerAttributeView
      • getFileGroup

        public java.lang.String getFileGroup()
        Returns file group if defined and the OS supports posix/group file attribute view, null otherwise.
        Returns:
        File group
        See Also:
        PosixFileAttributeView