public class SftpSubsystem extends Subsystem<SshServerContext>
com.maverick.sshd.platform.FileSystem
to serve files
through the SFTP protocol. This implementation currently supports up to
version 3 of the protocol.Subsystem.ParseMessageOperation
Constructor and Description |
---|
SftpSubsystem() |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanupSubsystem() |
protected void |
fireCloseFileEvent(byte[] handle,
Exception error) |
protected void |
fireCloseFileEvent(com.sshtools.server.SftpSubsystem.TransferEvent evt,
Exception error) |
protected void |
fireEvent(Event event) |
protected void |
fireMakeDirectoryEvent(String path,
Date started,
Exception error) |
protected void |
fireOpenDirectoryEvent(String path,
Date started,
Exception error) |
protected void |
fireOpenFileEvent(UnsignedInteger32 flags,
SftpFileAttributes attrs,
String path,
Date started,
Exception error) |
protected void |
fireRemoveFileEvent(String path,
Date started,
Exception error) |
protected void |
fireRenameFileEvent(String oldpath,
String newpath,
Date started,
Exception error) |
protected void |
fireRmDirEvent(String path,
Date started,
Exception error) |
protected void |
fireStatEvent(String path,
SftpFileAttributes old,
SftpFileAttributes attrs,
Date started,
Exception error) |
protected void |
fireSymlinkEvent(String linkpath,
String targetpath,
Date started,
Exception error) |
static String |
formatLongname(SftpFileAttributes attrs,
String filename,
Locale locale)
Deprecated.
|
static String |
formatLongname(SftpFile file,
Locale locale)
Deprecated.
|
protected void |
onInit(Channel<SshServerContext> session,
SshServerContext context) |
protected void |
onMessageReceived(byte[] msg)
Called when a subsystem message has been extracted from the incoming data
stream.
|
protected void |
onSubsystemFree()
Called to free the subsystem and its resources.
|
cleanup, executeOperation, free, getContext, init, parseMessage, processMessage, sendMessage
public static final int SSH_FX_INVALID_HANDLE
public static final int SSH_FX_NO_SUCH_PATH
public static final int SSH_FX_FILE_ALREADY_EXISTS
public static final int SSH_FX_WRITE_PROTECT
public static final int SSH_FX_NO_MEDIA
public static final int SSH_FX_NO_SPACE_ON_FILESYSTEM
public static final int SSH_FX_QUOTA_EXCEEDED
public static final int SSH_FX_UNKNOWN_PRINCIPAL
public static final int SSH_FX_LOCK_CONFLICT
public static final int SSH_FX_DIR_NOT_EMPTY
public static final int SSH_FX_NOT_A_DIRECTORY
public static final int SSH_FX_INVALID_FILENAME
public static final int SSH_FX_LINK_LOOP
public static final int SSH_FX_CANNOT_DELETE
public static final int SSH_FX_INVALID_PARAMETER
public static final int SSH_FX_FILE_IS_A_DIRECTORY
public static final int SSH_FX_BYTE_RANGE_LOCK_CONFLICT
public static final int SSH_FX_BYTE_RANGE_LOCK_REFUSED
public static final int SSH_FX_DELETE_PENDING
public static final int SSH_FX_FILE_CORRUPT
public static final int SSH_FX_OWNER_INVALID
public static final int SSH_FX_GROUP_INVALID
public static final int SSH_FX_NO_MATCHING_BYTE_RANGE_LOCK
public static final String SUBSYSTEM_NAME
protected void onInit(Channel<SshServerContext> session, SshServerContext context) throws IOException
onInit
in class Subsystem<SshServerContext>
IOException
protected void cleanupSubsystem()
cleanupSubsystem
in class Subsystem<SshServerContext>
protected void onSubsystemFree()
onSubsystemFree
in class Subsystem<SshServerContext>
protected void onMessageReceived(byte[] msg) throws IOException
Subsystem
onMessageReceived
in class Subsystem<SshServerContext>
IOException
protected void fireStatEvent(String path, SftpFileAttributes old, SftpFileAttributes attrs, Date started, Exception error)
protected void fireSymlinkEvent(String linkpath, String targetpath, Date started, Exception error)
protected void fireRenameFileEvent(String oldpath, String newpath, Date started, Exception error)
protected void fireOpenFileEvent(UnsignedInteger32 flags, SftpFileAttributes attrs, String path, Date started, Exception error)
protected void fireCloseFileEvent(byte[] handle, Exception error)
protected void fireCloseFileEvent(com.sshtools.server.SftpSubsystem.TransferEvent evt, Exception error)
protected void fireOpenDirectoryEvent(String path, Date started, Exception error)
public static String formatLongname(SftpFile file, Locale locale)
file
- locale
- public static String formatLongname(SftpFileAttributes attrs, String filename, Locale locale)
-rwxr-xr-x 1 mjos staff 348911 Mar 25 14:29 t-filexfer
attrs
- filename
- protected void fireMakeDirectoryEvent(String path, Date started, Exception error)
protected void fireEvent(Event event)
Copyright © 2016. All rights reserved.