Class SimpleAccessControlScpEventListener
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.scp.common.AbstractScpTransferEventListenerAdapter
-
- org.apache.sshd.contrib.server.scp.SimpleAccessControlScpEventListener
-
- All Implemented Interfaces:
java.util.EventListener
,org.apache.sshd.common.util.SshdEventListener
,org.apache.sshd.scp.common.ScpTransferEventListener
public abstract class SimpleAccessControlScpEventListener extends org.apache.sshd.scp.common.AbstractScpTransferEventListenerAdapter
Provides a simple access control by making a distinction between methods that upload data and ones that download it
-
-
Field Summary
Fields Modifier and Type Field Description static SimpleAccessControlScpEventListener
READ_ONLY_ACCESSOR
-
Constructor Summary
Constructors Modifier Constructor Description protected
SimpleAccessControlScpEventListener()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract boolean
isFileDownloadAllowed(org.apache.sshd.common.session.Session session, java.nio.file.Path path)
protected abstract boolean
isFileUploadAllowed(org.apache.sshd.common.session.Session session, java.nio.file.Path path)
void
startFileEvent(org.apache.sshd.common.session.Session session, org.apache.sshd.scp.common.ScpTransferEventListener.FileOperation op, java.nio.file.Path file, long length, java.util.Set<java.nio.file.attribute.PosixFilePermission> perms)
void
startFolderEvent(org.apache.sshd.common.session.Session session, org.apache.sshd.scp.common.ScpTransferEventListener.FileOperation op, java.nio.file.Path file, java.util.Set<java.nio.file.attribute.PosixFilePermission> perms)
-
Methods inherited from class org.apache.sshd.scp.common.AbstractScpTransferEventListenerAdapter
endFileEvent, endFolderEvent
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
-
-
-
-
Field Detail
-
READ_ONLY_ACCESSOR
public static final SimpleAccessControlScpEventListener READ_ONLY_ACCESSOR
-
-
Method Detail
-
startFileEvent
public void startFileEvent(org.apache.sshd.common.session.Session session, org.apache.sshd.scp.common.ScpTransferEventListener.FileOperation op, java.nio.file.Path file, long length, java.util.Set<java.nio.file.attribute.PosixFilePermission> perms) throws java.io.IOException
- Specified by:
startFileEvent
in interfaceorg.apache.sshd.scp.common.ScpTransferEventListener
- Overrides:
startFileEvent
in classorg.apache.sshd.scp.common.AbstractScpTransferEventListenerAdapter
- Throws:
java.io.IOException
-
startFolderEvent
public void startFolderEvent(org.apache.sshd.common.session.Session session, org.apache.sshd.scp.common.ScpTransferEventListener.FileOperation op, java.nio.file.Path file, java.util.Set<java.nio.file.attribute.PosixFilePermission> perms) throws java.io.IOException
- Specified by:
startFolderEvent
in interfaceorg.apache.sshd.scp.common.ScpTransferEventListener
- Overrides:
startFolderEvent
in classorg.apache.sshd.scp.common.AbstractScpTransferEventListenerAdapter
- Throws:
java.io.IOException
-
isFileDownloadAllowed
protected abstract boolean isFileDownloadAllowed(org.apache.sshd.common.session.Session session, java.nio.file.Path path) throws java.io.IOException
- Parameters:
session
- The client/serverSession
through which the transfer is being executedpath
- The local file/folder path- Returns:
true
if client is allowed to read from the specified local path- Throws:
java.io.IOException
- If failed to handle the call
-
isFileUploadAllowed
protected abstract boolean isFileUploadAllowed(org.apache.sshd.common.session.Session session, java.nio.file.Path path) throws java.io.IOException
- Parameters:
session
- The client/serverSession
through which the transfer is being executedpath
- The local file/folder path- Returns:
true
if client is allowed to write to the specified local path- Throws:
java.io.IOException
- If failed to handle the call
-
-