@Service public class SshService extends BaseOperService<SshModel> implements BaseDynamicService
Constructor and Description |
---|
SshService() |
Modifier and Type | Method and Description |
---|---|
void |
addItem(SshModel sshModel)
添加实体
|
boolean |
checkSshRun(SshModel sshModel,
String tag)
检查是否存在正在运行的进程
|
void |
download(SshModel sshModel,
String remoteFile,
File save)
下载文件
|
String |
exec(SshModel sshModel,
String command)
执行命令
|
com.jcraft.jsch.Session |
getSession(SshModel sshModel) |
List<SshModel> |
list()
获取所有数据
|
com.alibaba.fastjson.JSONArray |
listToArray(String dataId)
查询动态数据的array
|
void |
uploadDir(SshModel sshModel,
String remotePath,
File desc)
上传文件
|
deleteItem, getItem, list, updateItem
deleteJson, getDataFilePath, getJSONObject, getJsonObjectById, saveJson, updateJson
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convertArray, doChildren, filter, filter, listDynamic, parserChildren, parserValue
public void addItem(SshModel sshModel)
BaseOperService
addItem
in class BaseOperService<SshModel>
sshModel
- 实体public com.alibaba.fastjson.JSONArray listToArray(String dataId)
BaseDynamicService
listToArray
in interface BaseDynamicService
dataId
- 上级数据idpublic List<SshModel> list()
BaseOperService
list
in class BaseOperService<SshModel>
public com.jcraft.jsch.Session getSession(SshModel sshModel)
public boolean checkSshRun(SshModel sshModel, String tag) throws IOException, com.jcraft.jsch.JSchException
sshModel
- sshtag
- 标识IOException
- IOcom.jcraft.jsch.JSchException
- jschpublic String exec(SshModel sshModel, String command) throws IOException, com.jcraft.jsch.JSchException
sshModel
- sshcommand
- 命令IOException
- iocom.jcraft.jsch.JSchException
- jschpublic void uploadDir(SshModel sshModel, String remotePath, File desc) throws FileNotFoundException, com.jcraft.jsch.SftpException
sshModel
- sshremotePath
- 远程路径desc
- 文件夹或者文件FileNotFoundException
- 文件异常com.jcraft.jsch.SftpException
- ftppublic void download(SshModel sshModel, String remoteFile, File save) throws FileNotFoundException, com.jcraft.jsch.SftpException
sshModel
- remoteFile
- save
- FileNotFoundException
com.jcraft.jsch.SftpException
Copyright © 2017–2019. All rights reserved.