[
https://issues.apache.org/jira/browse/SSHD-1128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17286883#comment-17286883
]
Lyor Goldstein edited comment on SSHD-1128 at 2/19/21, 9:53 AM:
----------------------------------------------------------------
{quote}
Files#isHidden:
Tells whether or not a file is considered hidden. The exact definition of
hidden is platform or provider dependent. On UNIX for example a file is
considered to be hidden if its name begins with a period character ('.'). On
Windows a file is considered hidden if it isn't a directory and the DOS
DosFileAttributes#isHidden attribute is set.
{quote}
This raises an interesting question - how do we define "hidden" for and SFTP
filesystem. After all it is neither UNIX nor Windows - merely an +abstraction+
of a remote file system that may be UNIX, Windows or something else entirely.
Furthermore, the documentation clearly states:
{quote}
The exact definition of hidden is platform or provider dependent
{quote}
Therefore the decision that there are no hidden files falls within its scope -
thus this is not a bug (I have converted it to a feature request).
Additionally, please note that the {{SftpFileSystemProvider}} is limited to
whatever data the SFTP protocol provides to its +clients+ - and this data
unfortunately does not include any indication as to whether the remote file is
hidden or not. The only way we could provide that is via is a concept of
"extended" file attributes - which might work as long as both server and client
are MINA SSHD, but would not work in the general case.
You can easily write your own class that extends {{SftpFileSystemProvider}}
and applies whatever logic you want to decide whether a file is hidden, but I
am not sure we can provide a good default implementation that would not upset
someone else. I would be happy to hear any ideas for solution you might have
given the above...
was (Author: lgoldstein):
{quote}
Files#isHidden:
Tells whether or not a file is considered hidden. The exact definition of
hidden is platform or provider dependent. On UNIX for example a file is
considered to be hidden if its name begins with a period character ('.'). On
Windows a file is considered hidden if it isn't a directory and the DOS
DosFileAttributes#isHidden attribute is set.
{quote}
This raises an interesting question - how do we define "hidden" for and SFTP
filesystem. After all it is neither UNIX nor Windows - merely an +abstraction+
of a remote file system that may be UNIX, Windows or something else entirely.
Furthermore, the documentation clearly states:
{quote}
The exact definition of hidden is platform or provider dependent
{quote}
Therefore the decision that there are no hidden files falls within its scope -
thus this is not a bug (I have converted it to a feature request).
Additionally, please note that the {{SftpFileSystemProvider}} is limited to
whatever data the SFTP protocol provides to its +clients+ - and this data
unfortunately does not include any indication as to whether the remote file is
hidden or not. The only way we could provide that is via is a concept of
"extended" file attributes - which might work as long as both server and client
are MINA SSHD, but would not work in the general case.
I would be happy to hear any ideas for solution you might have given the
above...
> Files.isHidden() always false
> ------------------------------
>
> Key: SSHD-1128
> URL: https://issues.apache.org/jira/browse/SSHD-1128
> Project: MINA SSHD
> Issue Type: Improvement
> Reporter: Logan
> Priority: Minor
> Fix For: 2.1.0, 2.6.0
>
>
> When connected to sftp and reading file attributes `Files.isHidden()` always
> return false. Digger deeper into the code `SftpFileSystemProvider.isHidden()`
> is hard coded to return false. Is this something that can fixed to adopt
> `Files.isHidden()` specification?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]