FileSystemFactory factory = ((ServerSession) session).getFactoryManager().getFileSystemFactory();
((FileSystemAware) command).setFileSystemView(factory.createFileSystemView(session));
}
// If the shell wants to use non-blocking io
if (command instanceof AsyncCommand) {
asyncOut = new ChannelAsyncOutputStream(this, SshConstants.SSH_MSG_CHANNEL_DATA);
asyncErr = new ChannelAsyncOutputStream(this, SshConstants.SSH_MSG_CHANNEL_EXTENDED_DATA);
((AsyncCommand) command).setIoOutputStream(asyncOut);
((AsyncCommand) command).setIoErrorStream(asyncErr);
} else {
out = new ChannelOutputStream(this, remoteWindow, log, SshConstants.SSH_MSG_CHANNEL_DATA);
err = new ChannelOutputStream(this, remoteWindow, log, SshConstants.SSH_MSG_CHANNEL_EXTENDED_DATA);