Class SftpUtils

java.lang.Object
org.apache.sshd.sftp.client.fs.impl.SftpUtils

public final class SftpUtils extends Object
Internal utilities for SFTP file systems.
Author:
Apache MINA SSHD Project
  • Field Details

    • DIRECTORY_WITH_DOTS

      public static final ThreadLocal<Boolean> DIRECTORY_WITH_DOTS
      For internal uses, this can be set to Boolean.TRUE to indicate that a SftpDirectoryStream created shall report the "." and ".." entries (which Java normally doesn't do, but which we do get from the SFTP server). The stream, if it recognizes this, will set the value to null, so code using this can check after having created the stream whether it will return these entries (value is null). Intended usage:
       SftpUtils.DIRECTORY_WITH_DOTS.set(Boolean.TRUE);
       DirectoryStream<Path> dir = Files.newDirectoryStream(somePath);
       boolean withDots = SftpUtils.DIRECTORY_WITH_DOTS.get() == null;
       SftpUtil.DIRECTORY_WITH_DOTS.remove();