public abstract class FilePathFilter extends Object
FilePath
access from remote channels.
Returning true
indicates that the access is accepted. No other FilePathFilter
will be consulted to reject the execution, and the access will go through. Returning false
indicates "I don't know". Other FilePathFilter
s get to inspect the access, and they might
accept/reject access. And finally, throwing SecurityException
is to reject the access.
To insert a custom FilePathFilter
into a connection,
see ChannelConfigurator.onChannelBuilding(ChannelBuilder, Object)
FilePath
Modifier and Type | Field and Description |
---|---|
static FilePathFilter |
UNRESTRICTED
Immutable instance that represents the filter that allows everything.
|
Constructor and Description |
---|
FilePathFilter() |
Modifier and Type | Method and Description |
---|---|
boolean |
create(File f)
Checks if the given file can be created.
|
static FilePathFilter |
current()
Returns an
FilePathFilter object that represents all the in-scope filters,
or null if none is needed. |
boolean |
delete(File f)
Checks if the given file/directory can be deleted.
|
void |
installTo(hudson.remoting.ChannelBuilder cb) |
void |
installTo(hudson.remoting.ChannelBuilder cb,
double d) |
boolean |
mkdirs(File f)
Checks if the given directory can be created.
|
boolean |
read(File f)
Checks if the given file/directory can be read.
|
boolean |
stat(File f)
Checks if the metadata of the given file/directory (as opposed to the content) can be accessed.
|
boolean |
symlink(File f)
Checks if a symlink can be created at 'f'
On POSIX, this corresponds to the 'w' permission of the file itself.
|
void |
uninstallFrom(hudson.remoting.Channel ch) |
boolean |
write(File f)
Checks if the given file can be written.
|
public static final FilePathFilter UNRESTRICTED
public boolean read(File f) throws SecurityException
SecurityException
public boolean write(File f) throws SecurityException
SecurityException
public boolean symlink(File f) throws SecurityException
SecurityException
public boolean mkdirs(File f) throws SecurityException
SecurityException
public boolean create(File f) throws SecurityException
SecurityException
public boolean delete(File f) throws SecurityException
SecurityException
public boolean stat(File f) throws SecurityException
SecurityException
public final void installTo(hudson.remoting.ChannelBuilder cb)
public final void installTo(hudson.remoting.ChannelBuilder cb, double d)
public final void uninstallFrom(hudson.remoting.Channel ch)
@CheckForNull public static FilePathFilter current()
FilePathFilter
object that represents all the in-scope filters,
or null if none is needed.Copyright © 2019. All rights reserved.