|
|
|
@ -23,9 +23,6 @@ import java.nio.charset.StandardCharsets;
|
|
|
|
|
import java.nio.file.Path;
|
|
|
|
|
import java.time.Duration;
|
|
|
|
|
|
|
|
|
|
import org.apache.sshd.common.Property;
|
|
|
|
|
import org.apache.sshd.common.PropertyResolver;
|
|
|
|
|
import org.apache.sshd.common.SshConstants;
|
|
|
|
|
import org.apache.sshd.common.util.ValidateUtils;
|
|
|
|
|
import org.apache.sshd.common.util.buffer.Buffer;
|
|
|
|
|
import org.apache.sshd.common.util.io.IoUtils;
|
|
|
|
@ -41,8 +38,6 @@ public final class SftpModuleProperties {
|
|
|
|
|
* Used to indicate the {@link Charset} (or its name) for decoding referenced files/folders names - extracted from
|
|
|
|
|
* the client session when 1st initialized.
|
|
|
|
|
*
|
|
|
|
|
* @see SftpClient#getNameDecodingCharset()
|
|
|
|
|
* @see SftpClient#setNameDecodingCharset(Charset)
|
|
|
|
|
*/
|
|
|
|
|
public static final Property<Charset> NAME_DECODING_CHARSET
|
|
|
|
|
= Property.charset("sftp-name-decoding-charset", StandardCharsets.UTF_8);
|
|
|
|
@ -54,45 +49,26 @@ public final class SftpModuleProperties {
|
|
|
|
|
public static final Property<Duration> SFTP_CHANNEL_OPEN_TIMEOUT
|
|
|
|
|
= Property.duration("sftp-channel-open-timeout", Duration.ofSeconds(15L));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* See {@link org.apache.sshd.sftp.client.fs.SftpFileSystem}.
|
|
|
|
|
*/
|
|
|
|
|
public static final Property<Integer> POOL_SIZE
|
|
|
|
|
= Property.integer("sftp-fs-pool-size", 8);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* See {@link org.apache.sshd.sftp.client.fs.SftpFileSystemProvider}.
|
|
|
|
|
*/
|
|
|
|
|
public static final Property<Integer> READ_BUFFER_SIZE
|
|
|
|
|
= Property.integer("sftp-fs-read-buffer-size");
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* See {@link org.apache.sshd.sftp.client.fs.SftpFileSystemProvider}.
|
|
|
|
|
*/
|
|
|
|
|
public static final Property<Integer> WRITE_BUFFER_SIZE
|
|
|
|
|
= Property.integer("sftp-fs-write-buffer-size");
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* See {@link org.apache.sshd.sftp.client.fs.SftpFileSystemProvider}.
|
|
|
|
|
*/
|
|
|
|
|
public static final Property<Duration> CONNECT_TIME
|
|
|
|
|
= Property.duration("sftp-fs-connect-time", Duration.ofSeconds(15L));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* See {@link org.apache.sshd.sftp.client.fs.SftpFileSystemProvider}.
|
|
|
|
|
*/
|
|
|
|
|
public static final Property<Duration> AUTH_TIME
|
|
|
|
|
= Property.duration("sftp-fs-auth-time", Duration.ofSeconds(15L));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* See {@link org.apache.sshd.sftp.client.fs.SftpFileSystemProvider}.
|
|
|
|
|
*/
|
|
|
|
|
public static final Property<Charset> NAME_DECODER_CHARSET
|
|
|
|
|
= Property.charset("sftp-fs-name-decoder-charset", StandardCharsets.UTF_8);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Property used to avoid large buffers when
|
|
|
|
|
* {@link org.apache.sshd.sftp.client.impl.AbstractSftpClient#write(SftpClient.Handle, long, byte[], int, int)} is
|
|
|
|
|
* invoked with a large buffer size.
|
|
|
|
|
*/
|
|
|
|
|
public static final Property<Integer> WRITE_CHUNK_SIZE
|
|
|
|
@ -122,25 +98,22 @@ public final class SftpModuleProperties {
|
|
|
|
|
/**
|
|
|
|
|
* Allows controlling reports of which client extensions are supported (and reported via "support" and
|
|
|
|
|
* "support2" server extensions) as a comma-separate list of names. <B>Note:</B> requires overriding the
|
|
|
|
|
* {@link AbstractSftpSubsystemHelper#executeExtendedCommand(Buffer, int, String)} command accordingly. If empty
|
|
|
|
|
* command accordingly. If empty
|
|
|
|
|
* string is set then no server extensions are reported
|
|
|
|
|
*
|
|
|
|
|
* @see AbstractSftpSubsystemHelper#DEFAULT_SUPPORTED_CLIENT_EXTENSIONS
|
|
|
|
|
*/
|
|
|
|
|
public static final Property<String> CLIENT_EXTENSIONS
|
|
|
|
|
= Property.string("sftp-client-extensions");
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Comma-separated list of which {@code OpenSSH} extensions are reported and what version is reported for each -
|
|
|
|
|
* format: {@code name=version}. If empty value set, then no such extensions are reported. Otherwise, the
|
|
|
|
|
* {@link AbstractSftpSubsystemHelper#DEFAULT_OPEN_SSH_EXTENSIONS} are used
|
|
|
|
|
* format: {@code name=version}. If empty value set, then no such extensions are reported.
|
|
|
|
|
*/
|
|
|
|
|
public static final Property<String> OPENSSH_EXTENSIONS
|
|
|
|
|
= Property.string("sftp-openssh-extensions");
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Comma separate list of {@code SSH_ACL_CAP_xxx} names - where name can be without the prefix. If not defined then
|
|
|
|
|
* {@link AbstractSftpSubsystemHelper#DEFAULT_ACL_SUPPORTED_MASK} is used
|
|
|
|
|
* Comma separate list of {@code SSH_ACL_CAP_xxx} names - where name can be without the prefix.
|
|
|
|
|
*/
|
|
|
|
|
public static final Property<String> ACL_SUPPORTED_MASK
|
|
|
|
|
= Property.string("sftp-acl-supported-mask");
|
|
|
|
@ -152,7 +125,7 @@ public final class SftpModuleProperties {
|
|
|
|
|
= Property.string("sftp-newline", IoUtils.EOL);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Force the use of a max. packet length for {@link AbstractSftpSubsystemHelper#doRead(Buffer, int)} protection
|
|
|
|
|
* Force the use of a max. packet length for protection
|
|
|
|
|
* against malicious packets
|
|
|
|
|
*/
|
|
|
|
|
public static final Property<Integer> MAX_READDATA_PACKET_LENGTH
|
|
|
|
@ -187,9 +160,6 @@ public final class SftpModuleProperties {
|
|
|
|
|
/**
|
|
|
|
|
* Max. rounds to attempt to create a unique file handle - if all handles already in use after these many rounds,
|
|
|
|
|
* then an exception is thrown
|
|
|
|
|
*
|
|
|
|
|
* @see SftpSubsystem#generateFileHandle(Path)
|
|
|
|
|
* @see #DEFAULT_FILE_HANDLE_ROUNDS
|
|
|
|
|
*/
|
|
|
|
|
public static final Property<Integer> MAX_FILE_HANDLE_RAND_ROUNDS
|
|
|
|
|
= Property.validating(
|
|
|
|
@ -200,8 +170,7 @@ public final class SftpModuleProperties {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Maximum amount of data allocated for listing the contents of a directory in any single invocation of
|
|
|
|
|
* {@link SftpSubsystem#doReadDir(Buffer, int)}
|
|
|
|
|
* Maximum amount of data allocated for listing the contents of a directory in any single invocation
|
|
|
|
|
*/
|
|
|
|
|
public static final Property<Integer> MAX_READDIR_DATA_SIZE
|
|
|
|
|
= Property.integer("sftp-max-readdir-data-size", 16 * 1024);
|
|
|
|
|