tomaswolf opened a new pull request #207: URL: https://github.com/apache/mina-sshd/pull/207
This greatly reduces the number of (L)STAT calls made to get SFTP attributes. Also, listing directories in reply to SSH_FXP_OPENDIR and SSH_FXP_READDIR can in this way still go through the normal `java.io.file.FileSystem` abstraction. There is no need anymore to bypass the file system to resolve SSHD-1217. The attributes cached on the `Path` objects returned from the `DirectoryStream` are used only for listing the directory. This is a similar optimization as was done in the Java libraries for a `FileTreeWalker` operating on an Unix filesystem, which may use cached attributes via the internal interface `sun.nio.fs.BasicFileAttributesHolder`. Caching is also enabled selectively in the up-front checks for file accessibility, which also caused repeated (L)STAT calls. Rewrite `IoUtils.checkFileExists()` to load attributes only once. The new operations for caching attributes on `SftpPath` instances are protected only; they are not intended to be used by client code. For access in the SFTP implementation itself, paths are now always created as `SftpPathImpl` instances, which inherit from `SftpPath` and publish a safe `withAttributeCache()` method. Theoretically client code could still access these methods, but then it's clear for everyone that these are internal operations. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org