garydgregory commented on a change in pull request #98:
URL: https://github.com/apache/commons-vfs/pull/98#discussion_r453190378



##########
File path: 
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
##########
@@ -164,6 +154,30 @@ protected ChannelSftp getChannel() throws IOException {
             throw new FileSystemException("vfs.provider.sftp/connect.error", 
getRootName(), e);
         }
     }
+       
+       /**

Review comment:
       Javadoc it not aligned.

##########
File path: 
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
##########
@@ -164,6 +154,30 @@ protected ChannelSftp getChannel() throws IOException {
             throw new FileSystemException("vfs.provider.sftp/connect.error", 
getRootName(), e);
         }
     }
+       
+       /**
+     * Returns an SFTP channel to the server.
+     *
+     * @return new channel.
+     * @throws JSchException if anything goes wrong with SSH protocol.
+     * @throws IOException   if an I/O error is detected.
+     */
+       private ChannelSftp createChannel() throws JSchException, IOException {
+           ChannelSftp channel = (ChannelSftp) 
getSession().openChannel("sftp");
+               channel.connect(connectTimeoutMillis);
+               final Boolean userDirIsRoot = 
SftpFileSystemConfigBuilder.getInstance()
+                               .getUserDirIsRoot(getFileSystemOptions());
+               final String workingDirectory = getRootName().getPath();
+               if (workingDirectory != null && (userDirIsRoot == null || 
!userDirIsRoot.booleanValue())) {

Review comment:
       Fix formatting.

##########
File path: 
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
##########
@@ -164,6 +154,30 @@ protected ChannelSftp getChannel() throws IOException {
             throw new FileSystemException("vfs.provider.sftp/connect.error", 
getRootName(), e);
         }
     }
+       
+       /**
+     * Returns an SFTP channel to the server.
+     *
+     * @return new channel.
+     * @throws JSchException if anything goes wrong with SSH protocol.
+     * @throws IOException   if an I/O error is detected.
+     */
+       private ChannelSftp createChannel() throws JSchException, IOException {
+           ChannelSftp channel = (ChannelSftp) 
getSession().openChannel("sftp");

Review comment:
       Use `final` where possible.




----------------------------------------------------------------
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]


Reply via email to