Module org.elasticsearch.security
Package org.elasticsearch.xpack.security
Class EntitledFileWatcher
java.lang.Object
org.elasticsearch.watcher.AbstractResourceWatcher<FileChangesListener>
org.elasticsearch.watcher.FileWatcher
org.elasticsearch.xpack.security.EntitledFileWatcher
- All Implemented Interfaces:
ResourceWatcher
A subclass of
FileWatcher that lives in the security module.
The Elasticsearch entitlement system uses a StackWalker to determine
which module is making a file-system call. FileWatcher lives in the server module
and therefore cannot access paths that are marked exclusive: true for the security
module (e.g. users and x-pack/users).
By overriding every protected file-I/O method here, the actual Files calls are
issued from inside org.elasticsearch.security, so the entitlement check correctly
attributes them to this module.
-
Constructor Summary
ConstructorsConstructorDescriptionEntitledFileWatcher(Path path) EntitledFileWatcher(Path path, boolean checkFileContents) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanfileExists(Path path) protected DirectoryStream<Path> protected InputStreamnewInputStream(Path path) protected BasicFileAttributesreadAttributes(Path path) Methods inherited from class org.elasticsearch.watcher.FileWatcher
clearState, doCheckAndNotify, doInit, getPathMethods inherited from class org.elasticsearch.watcher.AbstractResourceWatcher
addListener, checkAndNotify, init, listeners, remove
-
Constructor Details
-
EntitledFileWatcher
-
EntitledFileWatcher
-
-
Method Details
-
newInputStream
- Overrides:
newInputStreamin classFileWatcher- Throws:
IOException
-
fileExists
- Overrides:
fileExistsin classFileWatcher
-
readAttributes
- Overrides:
readAttributesin classFileWatcher- Throws:
IOException
-
listFiles
- Overrides:
listFilesin classFileWatcher- Throws:
IOException
-