[ 
https://issues.apache.org/jira/browse/SSHD-814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16445768#comment-16445768
 ] 

Goldstein Lyor commented on SSHD-814:
-------------------------------------

I don't understand the requirements:
{quote}
When upload/download a file complete
{quote}
There is no such SFTP command 'upload/download' a file - are you sure you are 
referring to SFTP and not SCP.

{quote}
When do a delete or rename or other action to a non-exist file or directory, 
there should has a callback function indicating which action failed.
{quote}
There are such callbacks:

{code:java}
   /**
     * Called <U>after</U> a file / directory has been removed
     *
     * @param session The {@link ServerSession} through which the request was 
handled
     * @param path    The {@link Path} to be removed
     * @param thrown  If not-{@code null} then the reason for the failure to 
execute
     * @throws IOException If failed to handle the call
     */
    default void removed(ServerSession session, Path path, Throwable thrown) 
throws IOException {
        // ignored
    }

   /**
     * Called <U>after</U> renaming a file / directory
     *
     * @param session The {@link ServerSession} through which the request was 
handled
     * @param srcPath The source {@link Path}
     * @param dstPath The target {@link Path}
     * @param opts    The resolved renaming options
     * @param thrown  If not-{@code null} then the reason for the failure to 
execute
     * @throws IOException If failed to handle the call
     */
    default void moved(ServerSession session, Path srcPath, Path dstPath, 
Collection<CopyOption> opts, Throwable thrown)
            throws IOException {
                // ignored
    }
{code}

 Again, I may be missing something but I don't see what "enrichment" is 
necessary - are you sure you are looking at version 1.7 ?

> enrich the SftpEventListener
> ----------------------------
>
>                 Key: SSHD-814
>                 URL: https://issues.apache.org/jira/browse/SSHD-814
>             Project: MINA SSHD
>          Issue Type: Improvement
>    Affects Versions: 1.7.0
>            Reporter: Zhenliang Su
>            Assignee: Goldstein Lyor
>            Priority: Minor
>              Labels: EventListener, sftp
>
> In practice, I found that, the callback function provided by 
> SftpEventListener is not enough.  For example, the following situation is not 
> easy to be notified in a elegant way:
> {code:java}
> download files that you do not have access to
> download a file that no longer exists
> upload files to a directory without permissions
> create a new file in a directory that you do not have access to
> download or upload a file complete
> upload a zero size file
> ...{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to