[
https://issues.apache.org/jira/browse/SSHD-992?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17107841#comment-17107841
]
Lyor Goldstein commented on SSHD-992:
-------------------------------------
{quote}
Probably some hooks similar SftpFileSystemAccessor openFile
{quote}
I am not clear as to how these hooks would behave and where to hook them in the
code. However, for the time being you could extend {{SftpSubsystem}} class and
override {{protected Map<String, Object> doStat(int id, String path, int
flags)}} (inherited from {{AbstractSftpSubsystemHelper}}) - same applies to
{{getAttributes}} method. Then you can use your class:
{code:java}
SshServer sshd = ....;
sshd.setSubsystemFactories(Collections.singletonList(new SftpSubsystemFactory()
{
@Override
public Command createSubsystem(ChannelSession channel) throws
IOException {
return new MySuperDuperSftpSubsystem(
resolveExecutorService(),
getUnsupportedAttributePolicy(), getFileSystemAccessor(),
getErrorStatusDataHandler());
}
}));
{code}
> Customizing sftp stat commands
> ------------------------------
>
> Key: SSHD-992
> URL: https://issues.apache.org/jira/browse/SSHD-992
> Project: MINA SSHD
> Issue Type: Improvement
> Affects Versions: 2.1.0
> Reporter: Logan
> Priority: Major
>
> We use SSHD servers to support SFTP functionality that when user uploads a
> file, we internally create a file with a unique name and handle this upload.
> While this customization is working it does break some clients that issue
> stat command after upload. Is there a hook or customization that I can do to
> handle the stat commands ourselves instead of default handler? Have the same
> issues with getting attributes of the file too. Probably some hooks similar
> SftpFileSystemAccessor openFile?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]