Java源码示例:org.apache.hadoop.fs.ftp.FTPFileSystem
示例1
@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;
}
示例2
/**
* 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;
}
}
示例3
/**
* 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;
}
}