add map method

This commit is contained in:
Looly
2021-01-18 16:26:13 +08:00
parent 03bfb46889
commit 5a91698a78
4 changed files with 31 additions and 9 deletions

View File

@@ -300,13 +300,7 @@ public class Ftp extends AbstractFtp {
@Override
public List<String> ls(String path) {
final FTPFile[] ftpFiles = lsFiles(path);
final List<String> fileNames = new ArrayList<>();
for (FTPFile ftpFile : ftpFiles) {
fileNames.add(ftpFile.getName());
}
return fileNames;
return ArrayUtil.map(lsFiles(path), FTPFile::getName);
}
/**