mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix ssh bug
This commit is contained in:
parent
da031ee61c
commit
6c62973048
@ -11,11 +11,13 @@
|
|||||||
* 【extra】 邮件发送后获取message-id(issue#I15FKR@Gitee)
|
* 【extra】 邮件发送后获取message-id(issue#I15FKR@Gitee)
|
||||||
* 【core 】 CaseInsensitiveMap/CamelCaseMap增加toString(issue#636@Github)
|
* 【core 】 CaseInsensitiveMap/CamelCaseMap增加toString(issue#636@Github)
|
||||||
* 【core 】 XmlUtil多节点改进(issue#I15I0R@Gitee)
|
* 【core 】 XmlUtil多节点改进(issue#I15I0R@Gitee)
|
||||||
|
* 【core 】 Thread.excAsync修正为execAsync(issue#642@Github)
|
||||||
|
|
||||||
### Bug修复
|
### Bug修复
|
||||||
* 【extra】 修复SFTP.upload上传失败的问题(issue#I15O40@Gitee)
|
* 【extra】 修复SFTP.upload上传失败的问题(issue#I15O40@Gitee)
|
||||||
* 【db】 修复findLike匹配错误问题
|
* 【db】 修复findLike匹配错误问题
|
||||||
* 【core 】 修复scale方法透明无效问题(issue#I15L5S@Gitee)
|
* 【core 】 修复scale方法透明无效问题(issue#I15L5S@Gitee)
|
||||||
|
* 【extra】 修复exec返回无效(issue#I15L5S@Gitee)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public class ThreadUtil {
|
|||||||
* @param isDaemon 是否守护线程。守护线程会在主线程结束后自动结束
|
* @param isDaemon 是否守护线程。守护线程会在主线程结束后自动结束
|
||||||
* @return 执行的方法体
|
* @return 执行的方法体
|
||||||
*/
|
*/
|
||||||
public static Runnable excAsync(final Runnable runnable, boolean isDaemon) {
|
public static Runnable execAsync(final Runnable runnable, boolean isDaemon) {
|
||||||
Thread thread = new Thread(runnable);
|
Thread thread = new Thread(runnable);
|
||||||
thread.setDaemon(isDaemon);
|
thread.setDaemon(isDaemon);
|
||||||
thread.start();
|
thread.start();
|
||||||
@ -432,6 +432,7 @@ public class ThreadUtil {
|
|||||||
* @param obj 对象所在线程
|
* @param obj 对象所在线程
|
||||||
* @since 4.5.6
|
* @since 4.5.6
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
|
||||||
public static void sync(Object obj) {
|
public static void sync(Object obj) {
|
||||||
synchronized (obj) {
|
synchronized (obj) {
|
||||||
try {
|
try {
|
||||||
|
@ -356,13 +356,13 @@ public class JschUtil {
|
|||||||
if (null == charset) {
|
if (null == charset) {
|
||||||
charset = CharsetUtil.CHARSET_UTF_8;
|
charset = CharsetUtil.CHARSET_UTF_8;
|
||||||
}
|
}
|
||||||
final ChannelExec channel = (ChannelExec) openChannel(session, ChannelType.EXEC);
|
final ChannelExec channel = (ChannelExec) createChannel(session, ChannelType.EXEC);
|
||||||
channel.setCommand(StrUtil.bytes(cmd, charset));
|
channel.setCommand(StrUtil.bytes(cmd, charset));
|
||||||
channel.setInputStream(null);
|
channel.setInputStream(null);
|
||||||
channel.setErrStream(errStream);
|
channel.setErrStream(errStream);
|
||||||
InputStream in = null;
|
InputStream in = null;
|
||||||
try {
|
try {
|
||||||
channel.start();
|
channel.connect();
|
||||||
in = channel.getInputStream();
|
in = channel.getInputStream();
|
||||||
return IoUtil.read(in, CharsetUtil.CHARSET_UTF_8);
|
return IoUtil.read(in, CharsetUtil.CHARSET_UTF_8);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user