use of com.orion.ops.entity.vo.sftp.FileDetailVO in project orion-ops by lijiahangmax.
the class SftpServiceImpl method listDir.
@Override
public FileListVO listDir(FileListRequest request) {
SftpExecutor executor = sftpBasicExecutorHolder.getBasicExecutor(request.getSessionToken());
synchronized (executor) {
String path = request.getPath();
List<SftpFile> fileList = executor.listDirs(path);
// 返回
FileListVO fileListVO = new FileListVO();
List<FileDetailVO> files = Converts.toList(fileList, FileDetailVO.class);
fileListVO.setPath(path);
fileListVO.setFiles(files);
return fileListVO;
}
}
use of com.orion.ops.entity.vo.sftp.FileDetailVO in project orion-ops by lijiahangmax.
the class SftpServiceImpl method list.
private FileListVO list(String path, Boolean all, SftpExecutor executor) {
synchronized (executor) {
List<SftpFile> fileList;
if (all == null || !all) {
// 不查询隐藏文件
fileList = executor.listFilesFilter(path, f -> !f.getName().startsWith("."), false, true);
} else {
// 查询隐藏文件
fileList = executor.ll(path);
}
// 返回
FileListVO fileListVO = new FileListVO();
List<FileDetailVO> files = Converts.toList(fileList, FileDetailVO.class);
fileListVO.setPath(path);
fileListVO.setFiles(files);
return fileListVO;
}
}
Aggregations