if (url.getProtocol().toLowerCase().equals("ftp")) {
String userInfo = url.getUserInfo();
String host = url.getHost();
String file = url.getPath();
FTPClient ftp = FTPUtils.connect(host, userInfo, new UserPasswordInputImpl());
ftp.pasv();
ftp.retr(file);
return new FTPStream(ftp);
} else {
return openConnectionStream(url, null);