Class SftpUtils


  • public final class SftpUtils
    extends java.lang.Object
    Internal utilities for SFTP file systems.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.ThreadLocal<java.lang.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).
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private SftpUtils()  
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DIRECTORY_WITH_DOTS

        public static final java.lang.ThreadLocal<java.lang.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();
         
    • Constructor Detail

      • SftpUtils

        private SftpUtils()