lgoldstein commented on a change in pull request #104: [SSHD-929] Create 
separate listener for remove directory.
URL: https://github.com/apache/mina-sshd/pull/104#discussion_r297317633
 
 

 ##########
 File path: 
sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java
 ##########
 @@ -1527,17 +1527,36 @@ protected void doRemoveDirectory(int id, String path, 
LinkOption... options) thr
      * @param p {@link Path} to delete
      * @throws IOException If failed to delete
      */
-    protected void doRemove(int id, Path p) throws IOException {
+    protected void doRemove(int id, Path p, boolean isDirectory) throws 
IOException {
         SftpEventListener listener = getSftpEventListenerProxy();
         ServerSession session = getServerSession();
-        listener.removing(session, p);
+
+        signalRemoving(p, listener, session, isDirectory);
         try {
             Files.delete(p);
         } catch (IOException | RuntimeException e) {
-            listener.removed(session, p, e);
+            signalRemoved(p, listener, session, isDirectory, e);
             throw e;
         }
-        listener.removed(session, p, null);
+        signalRemoved(p, listener, session, isDirectory, null);
+    }
+
+    private void signalRemoving(Path p, SftpEventListener listener, 
ServerSession session,
 
 Review comment:
   protected  please - we always try to allow users to override any behavior 
they like

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to