@Override protected FileSystem getFSInstance() throws IOException { FTPFileSystem ftpFileSystem = new FTPFileSystem(); String ftpUri = "ftp://" + userName + ":" + password + "@" + host + ":" + port; LOG.debug("ftp uri {}", ftpUri); ftpFileSystem.initialize(URI.create(ftpUri), configuration); return ftpFileSystem; }
/** * Check the exception was about cross-directory renames * -if not, rethrow it. * @param e exception raised * @throws IOException */ private void verifyUnsupportedDirRenameException(IOException e) throws IOException { if (!e.toString().contains(FTPFileSystem.E_SAME_DIRECTORY_ONLY)) { throw e; } }