garydgregory commented on a change in pull request #75: VFS-590 VFS-617 Proceed 
with moveTo operation if the exec channel for…
URL: https://github.com/apache/commons-vfs/pull/75#discussion_r360711375
 
 

 ##########
 File path: 
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
 ##########
 @@ -76,12 +80,18 @@
      */
     private volatile int[] groupsIds;
 
+    /**
+     * Some SFTP-only servers disable the exec channel. When exec is disabled, 
things like getUId() will always fail.
+     */
+    private boolean execDisabled;
+
     protected SftpFileSystem(final GenericFileName rootName, final Session 
session,
             final FileSystemOptions fileSystemOptions) {
         super(rootName, null, fileSystemOptions);
         this.session = Objects.requireNonNull(session, "session");
         this.connectTimeoutMillis = SftpFileSystemConfigBuilder.getInstance()
                 .getConnectTimeoutMillis(fileSystemOptions);
+        detectExecDisabled();
 
 Review comment:
   @apearc03 
   
   Thank you for updating the ASL headers.
   
   Unless you expect the state of a server to change and re-detect 
`execDisabled`, please make `execDisabled` `final` and make 
`detectExecDisabled()` return a `boolean`.  A boolean method would be cleaner 
anyway IMO. Then the ctor can say:
   ```
   this.execDisable = detectExecDisabled();
   ```
   
   We can always drop the `final` on the ivar later if `detectExecDisabled()` 
needs to be called post construction.
   
   

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to