code: @Override
      public File downloadResource(final String url, final String path)
              throws ResourceDownloadError {
          JSch jsch = new JSch();
  
          String[] sftpPath = url.substring(7).split("\\@");
          final String[] userCreds = sftpPath[0].split("\\:");
  
          try {
              String host;
              int port = ProtocolHandlerConstants.DEFAULT_SSH_PORT;
              String filePath = sftpPath[1].substring(sftpPath[1].indexOf('/'));
  
              String[] location = sftpPath[1].split("\\/");
              if (location[0].contains(":")) {
                  String[] hostPort = location[0].split("\\:");
  
                  host = hostPort[0];
                  port = Integer.parseInt(hostPort[1]);
              } else {
                  host = location[0];
              }
  
              if (userCreds == null || userCreds.length == 0) {
                  throw new UnsupportedOperationException(
                          "Non-specified user in sftp URL not supported yet.");
              }
  
              Session session = jsch.getSession(userCreds[0], host, port);
              session.setConfig("StrictHostKeyChecking", "no"); //don't validate against a known_hosts file
              session.setConfig("PreferredAuthentications",
                      "password,gssapi-with-mic,publickey,keyboard-interactive");
  
              if (userCreds.length == 1) {
                  session.setUserInfo(ui);
              } else {
                  session.setPassword(userCreds[1]);
              }
  
              session.connect();
  
              Channel channel = session.openChannel("sftp");
              channel.connect();
              ChannelSftp c = (ChannelSftp) channel;
  
              File downloadFile = new File(path);
              FileOutputStream tempFileOutputStream =
                      new FileOutputStream(downloadFile);
  
              IOUtils.copy(c.get(filePath), tempFileOutputStream);
              channel.disconnect();
              session.disconnect();
  
              return downloadFile;
          } catch (Exception e) {
              final String msg = "Error downloading namespace";
              throw new ResourceDownloadError(url, msg, e);
          }
      }
docs: {@inheritDoc}