use of com.orion.ops.entity.vo.sftp.FileOpenVO in project orion-ops by lijiahangmax.
the class SftpServiceImpl method open.
@Override
public FileOpenVO open(Long machineId) {
// 获取当前用户
Long userId = Currents.getUserId();
// 生成token
String sessionToken = this.generatorSessionToken(userId, machineId);
SftpExecutor executor = sftpBasicExecutorHolder.getBasicExecutor(sessionToken);
// 查询列表
String path = executor.getHome();
FileListVO list = this.list(path, false, executor);
// 返回数据
FileOpenVO openVO = new FileOpenVO();
openVO.setSessionToken(sessionToken);
openVO.setHome(path);
openVO.setCharset(executor.getCharset());
openVO.setPath(list.getPath());
openVO.setFiles(list.getFiles());
// 设置日志参数
EventParamsHolder.addParam(EventKeys.MACHINE_NAME, machineInfoService.getMachineName(machineId));
return openVO;
}
Aggregations