Class PosixViewAttributeAction
- java.lang.Object
-
- org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
-
- org.apache.logging.log4j.core.appender.rolling.action.AbstractPathAction
-
- org.apache.logging.log4j.core.appender.rolling.action.PosixViewAttributeAction
-
@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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PosixViewAttributeAction.Builder
Builder for the posix view attribute action.
-
Field Summary
-
Fields inherited from class org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
LOGGER
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FileVisitor<Path>
createFileVisitor(Path basePath, List<PathCondition> conditions)
Creates a newFileVisitor<Path>
to pass to theFiles.walkFileTree(Path, Set, int, FileVisitor)
method when theAbstractPathAction.execute()
method is invoked.String
getFileGroup()
Returns file group if defined and the OS supports posix/group file attribute view, null otherwise.String
getFileOwner()
Returns file owner if defined and the OS supports owner file attribute view, null otherwise.Set<PosixFilePermission>
getFilePermissions()
Returns posix file permissions if defined and the OS supports posix file attribute, null otherwise.static PosixViewAttributeAction.Builder
newBuilder()
String
toString()
-
Methods inherited from class org.apache.logging.log4j.core.appender.rolling.action.AbstractPathAction
execute, execute, getBasePath, getBasePathString, getMaxDepth, getOptions, getPathConditions, getStrSubstitutor, isFollowSymbolicLinks
-
Methods inherited from class org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
close, isComplete, isInterrupted, reportException, run
-
-
-
-
Method Detail
-
newBuilder
@PluginBuilderFactory public static PosixViewAttributeAction.Builder newBuilder()
-
createFileVisitor
protected FileVisitor<Path> createFileVisitor(Path basePath, List<PathCondition> conditions)
Description copied from class:AbstractPathAction
Creates a newFileVisitor<Path>
to pass to theFiles.walkFileTree(Path, Set, int, FileVisitor)
method when theAbstractPathAction.execute()
method is invoked.The visitor is responsible for processing the files it encounters that are accepted by all filters.
- Specified by:
createFileVisitor
in classAbstractPathAction
- Parameters:
basePath
- base dir from where to start scanning for files to processconditions
- filters that determine if a file should be processed- Returns:
- a new
FileVisitor<Path>
-
getFilePermissions
public Set<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 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 String getFileGroup()
Returns file group if defined and the OS supports posix/group file attribute view, null otherwise.- Returns:
- File group
- See Also:
PosixFileAttributeView
-
toString
public String toString()
- Overrides:
toString
in classAbstractPathAction
-
-